original_string: public function actionIndex($slug)
      {
          $this->trigger(self::EVENT_BEFORE_VIEW_SHOW);
  
          $data['slug'] = $slug;
          $data['route'] = '/' . $this->getRoute();
  
          $videoFinder = new VideoFinder();
          $data['video'] = $videoFinder->findBySlug($slug);
  
          if (empty($data['video'])) {
              throw new NotFoundHttpException('The requested page does not exist.');
          }
  
          $settings = Yii::$app->settings->getAll();
          $settings['videos'] = Module::getInstance()->settings->getAll();
  
          if ($data['video']['template'] !== '') {
              $template = $data['video']['template'];
          } else {
              $template = 'view';
          }
  
          Event::on(self::class, self::EVENT_AFTER_VIEW_SHOW, [\ytubes\videos\events\UpdateCountersEvent::class, 'onClickVideo'], $data);
  
          $this->trigger(self::EVENT_AFTER_VIEW_SHOW);
  
          return $this->render($template, [
              'data' => $data,
              'settings' => $settings
          ]);
      }
code: public function actionIndex($slug)
      {
          $this->trigger(self::EVENT_BEFORE_VIEW_SHOW);
  
          $data['slug'] = $slug;
          $data['route'] = '/' . $this->getRoute();
  
          $videoFinder = new VideoFinder();
          $data['video'] = $videoFinder->findBySlug($slug);
  
          if (empty($data['video'])) {
              throw new NotFoundHttpException('The requested page does not exist.');
          }
  
          $settings = Yii::$app->settings->getAll();
          $settings['videos'] = Module::getInstance()->settings->getAll();
  
          if ($data['video']['template'] !== '') {
              $template = $data['video']['template'];
          } else {
              $template = 'view';
          }
  
          Event::on(self::class, self::EVENT_AFTER_VIEW_SHOW, [\ytubes\videos\events\UpdateCountersEvent::class, 'onClickVideo'], $data);
  
          $this->trigger(self::EVENT_AFTER_VIEW_SHOW);
  
          return $this->render($template, [
              'data' => $data,
              'settings' => $settings
          ]);
      }
code_tokens: public function actionIndex ( $ slug ) { $ this -> trigger ( self :: EVENT_BEFORE_VIEW_SHOW ) ; $ data [ 'slug' ] = $ slug ; $ data [ 'route' ] = '/' . $ this -> getRoute ( ) ; $ videoFinder = new VideoFinder ( ) ; $ data [ 'video' ] = $ videoFinder -> findBySlug ( $ slug ) ; if ( empty ( $ data [ 'video' ] ) ) { throw new NotFoundHttpException ( 'The requested page does not exist.' ) ; } $ settings = Yii :: $ app -> settings -> getAll ( ) ; $ settings [ 'videos' ] = Module :: getInstance ( ) -> settings -> getAll ( ) ; if ( $ data [ 'video' ] [ 'template' ] !== '' ) { $ template = $ data [ 'video' ] [ 'template' ] ; } else { $ template = 'view' ; } Event :: on ( self :: class , self :: EVENT_AFTER_VIEW_SHOW , [ \ ytubes \ videos \ events \ UpdateCountersEvent :: class , 'onClickVideo' ] , $ data ) ; $ this -> trigger ( self :: EVENT_AFTER_VIEW_SHOW ) ; return $ this -> render ( $ template , [ 'data' => $ data , 'settings' => $ settings ] ) ; }
docstring: Displays a single Videos model.
  @param integer $id
  @return mixed
docstring_tokens: Displays a single Videos model .