A
A
Alexander Ivanov2018-03-10 19:39:56
Yii
Alexander Ivanov, 2018-03-10 19:39:56

Why is the action not working in the controller?

There is a page template with a button to delete elements.

echo "<div class='main_project'>
      <div class='info_project'>
            <div class='name_project'>
            $name
            </div>
            
            <div class='url_project'>
            URL <a href='$url' target='_blank'> $url</a>
            </div>
            
            <div class='resurs_project'>
            Используемые ресурсы при разработке: $resurs
            </div>
            
            <div class='studio_project'>
            Проект реализован в студии: <a href='#'>$studio</a>
            </div>
            <a href='$baseUrl/Deleteproject'>Удалить</a>
            <button>Редактировать</button>
                  </div>
            <div style='background: url($baseUrl/images/mon.png) no-repeat;' class='pic_sloy'>
            <a target='_blank' href='$baseUrl/images/projects/$pic'><img class='pic_project' src='$baseUrl/images/projects/$pic'></a>
            </div>	
      </div>";

Action is registered in the controller
public function actionDeleteproject()
    {
    print_r('test');
    die();
        return $this->render('index');
    
    }

the action does not work, when you click on the "delete" link, nothing happens.
Perhaps you need to create a nested controller? If yes, how to do it? I can't find a suitable example.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2018-03-10
@sidni

one)

$baseUrl/deleteproject

2) this is a mockery of the framework, what is this
echo
it is necessary to render the template normally and display only the values ​​of the variables through echo.
3) what
$baseUrl/
where does it come from? use standard helpers like Url:to or UrlManager functions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question