frontend/controllers/DownloadController.php
/**
     * Renders my downloads page
     *
     * @return mixed
     */
Renders my downloads page
@return mixed
Renders my downloads page @return mixed
public function actionMyDownloads()
    {
        $pageRepo = Yii::$container->get('common\repositories\PagesRepository');
        $pageMeta = $pageRepo->getPageMetaData('my-downloads');
        $pageTitle = $pageRepo->getPageTitle('my-downloads');
        $user = Yii::$app->user->identity;
        $unrestLinksQuery = UnrestrainedLink::find()->where(['user_id' => $user->id]);
        $unrestLinksCountQuery = clone $unrestLinksQuery;
        $pagination = new Pagination([
            'defaultPageSize' => 10,
            'totalCount' => $unrestLinksCountQuery->count(),
            'route' => Yii::getAlias('@profile_my_downloads')
        ]);
        $unrestLinksQuery->orderBy(['created' => SORT_DESC]);
        $unrestLinksQuery->offset($pagination->offset);
        $unrestLinksQuery->limit($pagination->limit);
        $this->layout = 'site';
        return $this->render('myDownloads', [
            'unrestrainedLinks' => $unrestLinksQuery->all(),
            'pag' => $pagination,
            'title'=>$pageTitle,
            'meta'=>$pageMeta
        ]);
    }
public function actionMyDownloads ( ) { $ pageRepo = Yii :: $ container -> get ( 'common\repositories\PagesRepository' ) ; $ pageMeta = $ pageRepo -> getPageMetaData ( 'my-downloads' ) ; $ pageTitle = $ pageRepo -> getPageTitle ( 'my-downloads' ) ; $ user = Yii :: $ app -> user -> identity ; $ unrestLinksQuery = UnrestrainedLink :: find ( ) -> where ( [ 'user_id' => $ user -> id ] ) ; $ unrestLinksCountQuery = clone $ unrestLinksQuery ; $ pagination = new Pagination ( [ 'defaultPageSize' => 10 , 'totalCount' => $ unrestLinksCountQuery -> count ( ) , 'route' => Yii :: getAlias ( '@profile_my_downloads' ) ] ) ; $ unrestLinksQuery -> orderBy ( [ 'created' => SORT_DESC ] ) ; $ unrestLinksQuery -> offset ( $ pagination -> offset ) ; $ unrestLinksQuery -> limit ( $ pagination -> limit ) ; $ this -> layout = 'site' ; return $ this -> render ( 'myDownloads' , [ 'unrestrainedLinks' => $ unrestLinksQuery -> all ( ) , 'pag' => $ pagination , 'title' => $ pageTitle , 'meta' => $ pageMeta ] ) ; }
Renders my downloads page
 @return mixed
Renders my downloads page @return mixed