Skip to content

Instantly share code, notes, and snippets.

@BumbuKhan
Created February 16, 2017 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BumbuKhan/2d593f3adb2b40d42f5a3d3684593108 to your computer and use it in GitHub Desktop.
Save BumbuKhan/2d593f3adb2b40d42f5a3d3684593108 to your computer and use it in GitHub Desktop.
How to pass variable to layout
// 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']?>
@BumbuKhan
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment