本文整理匯總了PHP中yii\base\Controller::init方法的典型用法代碼示例。如果您正苦於以下問題:PHP Controller::init方法的具體用法?PHP Controller::init怎麽用?PHP Controller::init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類yii\base\Controller
的用法示例。
在下文中一共展示了Controller::init方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
/**
* @inheritdoc
*/
public function init()
{
$this->_module = Yii::$app->getModule('redactorjs');
if ($this->_module === null) {
throw new InvalidConfigException("The module 'redactorjs' was not found. Ensure you have setup the 'redactorjs' module in your Yii configuration file.");
}
parent::init();
}
示例2: init
/**
* [init description]
* @return [type] [description]
*/
public function init()
{
parent::init();
// Set theme.
// @todo: Move to config.
$this->view->theme = new \yii\base\Theme(['pathMap' => ['@app/views' => '@app/themes/klangfarbe'], 'basePath' => '@app/themes/klangfarbe', 'baseUrl' => '@web/themes/klangfarbe']);
// Force theming.
$this->setViewPath('@app/themes/klangfarbe/' . $this->id);
// Define entry point.
$this->resolvePathRequested();
}
示例3: init
public function init()
{
parent::init();
// TODO: Change the autogenerated stub
}
示例4: init
public function init()
{
MultiLanguageHelper::catchLanguage();
parent::init();
}