V
V
Vyacheslav_Shilov2020-07-03 20:14:45
Yii
Vyacheslav_Shilov, 2020-07-03 20:14:45

What is the best way to implement a button in Yii1.1 that redirects the user to another controller?

Friends, what are the best ways to use to implement a button that redirects the user to another controller? I did this, but for some reason I have a bad feeling that this is not a very good way
. In this fragment, 'admin' is the name of the module, 'second' is the controller.

<?php echo CHtml::button('Firsts', array('submit' => array('../admin/second')));?>

Suddenly there will be some changes in the structure of the project, or the files will be renamed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-07-03
@Vyacheslav_Shilov

You have everything right. If changes occur on an existing project, then changing the link will not be enough. Since you will lose search transitions. To do this, make a redirect to a new address using the server. And there is such a thing as Routing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question