The YII framework obtains the current Controlle and action corresponding IDs, Yiicontrolle
This example describes the YII framework's approach to obtaining the current Controlle and action corresponding IDs. Share to everyone for your reference. Here's how:
In YIII framework development, you may want to get the ID of the current Controlle or action, in fact it is very simple, a code is implemented, the following is the code to get the current ID in the Controlle (Controller) and view (view) respectively.
In the controller:
Copy the Code code as follows: $name = $this->getid (); Controller
$name = $action->id; Action
In the View:
Copy the Code code as follows: $name = Yii::app ()->controller->id; Controller
$name = $this->getaction ()->getid (); Action
It is hoped that this article is helpful to the PHP program design based on YII framework.
http://www.bkjia.com/PHPjc/920981.html www.bkjia.com true http://www.bkjia.com/PHPjc/920981.html techarticle The Yii framework obtains the current Controlle and action corresponding IDs, Yiicontrolle This example describes the YII framework to obtain the current Controlle and action corresponding ID method. Share to everyone for your reference ...