controllers/RecentController.php
public function actionIndex($page = 1)
    {
        $this->trigger(self::EVENT_BEFORE_RECENT_SHOW);

        $data['page'] = (int) $page;
        $data['route'] = '/' . $this->getRoute();

        $finder = new VideoFinder();
        $data['videos'] = $finder->getNewVideos($page);
        $data['total_items'] = $finder->totalCount();

        $pagination = new Pagination([
            'totalCount' => $data['total_items'],
            'defaultPageSize' => Module::getInstance()->settings->get('items_per_page', 20),
            'pageSize' => Module::getInstance()->settings->get('items_per_page', 20),
            'route' => $data['route'],
            'forcePageParam' => false,
        ]);

        $settings = Yii::$app->settings->getAll();
        $settings['videos'] = Module::getInstance()->settings->getAll();

        $this->trigger(self::EVENT_AFTER_RECENT_SHOW);

        return $this->render('recent', [
            'data' => $data,
            'settings' => $settings,
            'pagination' => $pagination,
        ]);
    }
public function actionIndex($page = 1)
    {
        $this->trigger(self::EVENT_BEFORE_RECENT_SHOW);

        $data['page'] = (int) $page;
        $data['route'] = '/' . $this->getRoute();

        $finder = new VideoFinder();
        $data['videos'] = $finder->getNewVideos($page);
        $data['total_items'] = $finder->totalCount();

        $pagination = new Pagination([
            'totalCount' => $data['total_items'],
            'defaultPageSize' => Module::getInstance()->settings->get('items_per_page', 20),
            'pageSize' => Module::getInstance()->settings->get('items_per_page', 20),
            'route' => $data['route'],
            'forcePageParam' => false,
        ]);

        $settings = Yii::$app->settings->getAll();
        $settings['videos'] = Module::getInstance()->settings->getAll();

        $this->trigger(self::EVENT_AFTER_RECENT_SHOW);

        return $this->render('recent', [
            'data' => $data,
            'settings' => $settings,
            'pagination' => $pagination,
        ]);
    }
public function actionIndex ( $ page = 1 ) { $ this -> trigger ( self :: EVENT_BEFORE_RECENT_SHOW ) ; $ data [ 'page' ] = ( int ) $ page ; $ data [ 'route' ] = '/' . $ this -> getRoute ( ) ; $ finder = new VideoFinder ( ) ; $ data [ 'videos' ] = $ finder -> getNewVideos ( $ page ) ; $ data [ 'total_items' ] = $ finder -> totalCount ( ) ; $ pagination = new Pagination ( [ 'totalCount' => $ data [ 'total_items' ] , 'defaultPageSize' => Module :: getInstance ( ) -> settings -> get ( 'items_per_page' , 20 ) , 'pageSize' => Module :: getInstance ( ) -> settings -> get ( 'items_per_page' , 20 ) , 'route' => $ data [ 'route' ] , 'forcePageParam' => false , ] ) ; $ settings = Yii :: $ app -> settings -> getAll ( ) ; $ settings [ 'videos' ] = Module :: getInstance ( ) -> settings -> getAll ( ) ; $ this -> trigger ( self :: EVENT_AFTER_RECENT_SHOW ) ; return $ this -> render ( 'recent' , [ 'data' => $ data , 'settings' => $ settings , 'pagination' => $ pagination , ] ) ; }
Lists all Videos models.
@return mixed
Lists all Videos models .