Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function bootstrap($app)
 {
     if (is_string($this->include)) {
         $this->include = explode(',', $this->include);
     }
     $app->on(Application::EVENT_BEFORE_REQUEST, function () use($app) {
         if ($app->getModule('seo')->redirectWWW != self::NO_REDIRECT) {
             self::redirectWWW();
         }
         if ($app->getModule('seo')->redirectTrailingSlash == 1) {
             self::redirectSlash();
         }
         $app->getView()->on(View::EVENT_END_BODY, [Counter::className(), 'renderCounters'], $this->include);
     });
     // Analytics
     $app->on(Application::EVENT_BEFORE_ACTION, [AnalyticsHandler::className(), 'handleBeforeAction']);
     $app->on(Application::EVENT_BEFORE_ACTION, [Meta::className(), 'registrationMeta']);
 }