bubasuma\simplechat\Module::bootstrap PHP Method

bootstrap() public method

public bootstrap ( $app )
    public function bootstrap($app)
    {
        if ($app instanceof Web) {
            $app->getUrlManager()->addRules(['messages/<contactId:\\d+>' => $this->id . '/default/index', 'messages' => $this->id . '/default/index', 'login-as/<userId:\\d+>' => $this->id . '/default/login-as', 'chat/get/messages/<contactId:\\d+>' => $this->id . '/default/messages', 'chat/get/conversations' => $this->id . '/default/conversations', 'chat/delete/message/<id:\\d+>' => $this->id . '/default/delete-message', 'chat/delete/conversation/<contactId:\\d+>' => $this->id . '/default/delete-conversation', 'chat/post/message/<contactId:\\d+>' => $this->id . '/default/create-message', 'chat/unread/conversation/<contactId:\\d+>' => $this->id . '/default/mark-conversation-as-unread', 'chat/read/conversation/<contactId:\\d+>' => $this->id . '/default/mark-conversation-as-read'], false);
            if (!isset($app->getView()->renderers['twig'])) {
                $app->getView()->renderers['twig'] = ['class' => 'yii\\twig\\ViewRenderer'];
            }
            $app->getView()->renderers['twig']['globals']['html'] = '\\yii\\helpers\\Html';
        } elseif ($app instanceof Console) {
            $app->controllerMap[$this->id] = ['class' => 'bubasuma\\simplechat\\console\\DefaultController', 'module' => $this];
        }
    }