frontend/controllers/ResellerController.php
/**
     * Renders avaliabled products list
     *
     * @return mixed
     */
Renders avaliabled products list
@return mixed
Renders avaliabled products list @return mixed
public function actionProducts()
    {
        $user = Yii::$app->user->identity;
        $prodQuery = Product::find();
        $prodCountQuery = clone $prodQuery;
        $pagination = new Pagination([
            'defaultPageSize' => 10,
            'totalCount' => $prodCountQuery->count(),
            'route' => Yii::getAlias('@reseller_products')
        ]);
        $prodQuery->orderBy(['name' => SORT_DESC]);
        $prodQuery->offset($pagination->offset);
        $prodQuery->limit($pagination->limit);
        $fee = ResellerFee::findByUser($user);
        $pageRepo = Yii::$container->get('common\repositories\PagesRepository');
        $pageMeta = $pageRepo->getPageMetaData('reseller-products');
        $pageTitle = $pageRepo->getPageTitle('reseller-products');
        $this->layout = 'reseller';
        return $this->render('products', [
            'meta' => $pageMeta,
            'title' => $pageTitle,
            'products' => $prodQuery->all(),
            'fee' => $fee,
            'pag' => $pagination
        ]);
    }
public function actionProducts ( ) { $ user = Yii :: $ app -> user -> identity ; $ prodQuery = Product :: find ( ) ; $ prodCountQuery = clone $ prodQuery ; $ pagination = new Pagination ( [ 'defaultPageSize' => 10 , 'totalCount' => $ prodCountQuery -> count ( ) , 'route' => Yii :: getAlias ( '@reseller_products' ) ] ) ; $ prodQuery -> orderBy ( [ 'name' => SORT_DESC ] ) ; $ prodQuery -> offset ( $ pagination -> offset ) ; $ prodQuery -> limit ( $ pagination -> limit ) ; $ fee = ResellerFee :: findByUser ( $ user ) ; $ pageRepo = Yii :: $ container -> get ( 'common\repositories\PagesRepository' ) ; $ pageMeta = $ pageRepo -> getPageMetaData ( 'reseller-products' ) ; $ pageTitle = $ pageRepo -> getPageTitle ( 'reseller-products' ) ; $ this -> layout = 'reseller' ; return $ this -> render ( 'products' , [ 'meta' => $ pageMeta , 'title' => $ pageTitle , 'products' => $ prodQuery -> all ( ) , 'fee' => $ fee , 'pag' => $ pagination ] ) ; }
Renders avaliabled products list
 @return mixed
Renders avaliabled products list @return mixed