function init() { parent::init(); language(); hook('controller'); /* * load modules * 加载模块 */ if (!cache_pre('all_modules')) { \app\core\Modules::load(); } }
function init() { parent::init(); language('language_'); if (\Yii::$app->user->isGuest) { flash('error', __('login first')); redirect(url('auth/open/login')); } /* * load modules * 加载模块 */ if (!cache_pre('all_modules')) { \app\core\Modules::load(); } }