-
-
Save BumbuKhan/2d593f3adb2b40d42f5a3d3684593108 to your computer and use it in GitHub Desktop.
How to pass variable to layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in controller | |
Yii::$app->view->params['message_to_layout'] = 'This message will be shown in layout'; | |
// in layout (and in any view!) | |
<?=$this->params['message_to_layout']?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Read more http://weblog.codewebagency.com/yii-2-how-to-pass-param-from-controller-to-layout/