application->getComponent('Piko\I18n'); $user = $this->application->getComponent('Piko\User'); assert($user instanceof \Piko\User); // Pass some parameters to the View component $view = $this->application->getComponent('Piko\View'); $view->params['user'] = $user; $view->params['language'] = $this->application->language; // $view->attachBehavior('vite', 'app\lib\Vite::vite'); $vite = new Vite($view); $vite->loadEntry('main.js'); $userModule = $this->application->getModule('user'); assert ($userModule instanceof \app\modules\user\Module); $userModule->on(CreateControllerEvent::class, function(CreateControllerEvent $event) { $event->controller->on(BeforeActionEvent::class, function (BeforeActionEvent $event) { $action = $event->actionId; switch($action) { case 'login': $event->controller->layout = 'minimal'; break; } }); }); } }