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? -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -

c# - Get the Class name in a class with atribute inside a attribute method -