All properties and methods in the Controller class:
The layout that will be rendered when Smts::Render() is called.
Smts::Render()
This defaults to main.
main
To change the layout in an action:
self::$layout = 'secondary';
The value of the <title> tag in the rendered layout.
<title>
By default this is the value of DefaultTitle in the config.
DefaultTitle
To change the title in an action:
self::$title = 'Home';
As the name implies, beforeAction is called before every action. It can therefore be used to do something for every action in a controller.
beforeAction
For example, if you wanted an admin check for every page in a controller you could do something like:
public static function beforeAction( $var ) { if ( !User::isAdmin() ) { Smts::Redirect( Smts::$config . 'login' ); } }
There was an error while loading. Please reload this page.