public function init()
    {
        parent::init();
        $this->on(FrontendController::EVENT_BEFORE_ACTION, function() {
            // switch layout to admin or developer-defined in params
            $this->layout = isset(Yii::$app->params['admin.layout'])
                ? Yii::$app->params['admin.layout']
                : '@app/views/layouts/main';

            // register frontend monster
            AdminBundle::register($this->view);

            return true;
        });
    }