Yii2 get controller/action from url -


how in yii2 controller/action url. attention!!! ask yii2. there answers consern yii1 @ forum.

added. find smth yii::app()->geturlmanager()->parseurl('http://eewee.djn')); in yii2

added. refferer url anather conrtoller, want parse url yii2 , controller/action.

try this!

<?php echo yii::$app->controller->id; // controller id ?>   <?php echo yii::$app->controller->action->id; // controller action id ?> 

Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -

qt - Microsoft FTP Service 451 The parameter is incorrect -