YII – set default settings within module and controller

Which helps to overwrite default settings of module and controller. To set default controller, view, layout and theme.

Set default controller within module

[php]
/**
* @var string the default controller.
*/

public $defaultController = ‘controller_name’;
[/php]

To Set default layout, theme and views within controller, use the following commands.

[php]
/**
* @var string the default layout and view/action.
*/
public $layout = ‘layout_name’;
public $defaultAction = ‘action_name’;

/**
* @var string the default theme.
*/
Yii::app()->theme =’theme_name’;
[/php]

Permanent link to this article: https://blog.openshell.in/2013/04/yii-set-default-settings-within-module-and-controller/

Leave a Reply

Your email address will not be published.