當前位置: 首頁>>代碼示例>>PHP>>正文


PHP LuLu::getPagedRows方法代碼示例

本文整理匯總了PHP中source\LuLu::getPagedRows方法的典型用法代碼示例。如果您正苦於以下問題:PHP LuLu::getPagedRows方法的具體用法?PHP LuLu::getPagedRows怎麽用?PHP LuLu::getPagedRows使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在source\LuLu的用法示例。


在下文中一共展示了LuLu::getPagedRows方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionIndex

 public function actionIndex()
 {
     $query = Content::leftJoinWith('takonomy');
     $locals = LuLu::getPagedRows($query, ['orderBy' => 'created_at desc', 'pageSize' => 6]);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 5]]);
     $locals['dataProvider'] = $dataProvider;
     return $this->render('index', $locals);
 }
開發者ID:merlinxie,項目名稱:lulublog,代碼行數:8,代碼來源:SiteController.php

示例2: getPagedContents

 /**
  * 
  * @param string $where
  * @param string $orderBy
  * @param number $pageSize
  * @param array $options
  * --recommend
  * --headline
  * --sticky
  * --flag
  * --is_pic
  * --content_type
  * --page
  * --taxonomy:array or number
  * 
  * @return array:['rows','pager']
  */
 public static function getPagedContents($where = null, $orderBy = null, $pageSize = 10, $options = [])
 {
     $query = self::buildContentQuery($where, $options);
     $query->joinWith('taxonomy', true, 'LEFT JOIN');
     $page = isset($options['page']) ? $options['page'] : null;
     $orderBy = empty($orderBy) ? 'created_at desc' : $orderBy;
     $locals = LuLu::getPagedRows($query, ['page' => $page, 'pageSize' => $pageSize, 'orderBy' => $orderBy]);
     return $locals;
 }
開發者ID:sym660,項目名稱:lulucms2,代碼行數:26,代碼來源:DataSource.php

示例3: getPagedContents

 public static function getPagedContents($where = null, $pageSize = 10)
 {
     $query = Content::leftJoinWith('taxonomy');
     if (!empty($where)) {
         $query->andWhere($where);
     }
     $locals = LuLu::getPagedRows($query, ['orderBy' => 'created_at desc', 'pageSize' => $pageSize]);
     return $locals;
 }
開發者ID:hucongyang,項目名稱:lulucms2,代碼行數:9,代碼來源:DataSource.php

示例4: actionIndex

 public function actionIndex()
 {
     $query = Content::leftJoinWith('takonomy');
     $locals = LuLu::getPagedRows($query, [
         'orderBy' => 'created_at desc', 
         'pageSize' => 6
     ]);
     
     return $this->render('index', $locals);
 }
開發者ID:huasxin,項目名稱:lulucms2,代碼行數:10,代碼來源:SiteController.php

示例5: actionList

 public function actionList()
 {
     $takonomy = LuLu::getGetValue('takonomy');
     $takonomyModel = Takonomy::getOneOrDefault($takonomy);
     $query = Content::find();
     $query->where(['content_type' => $this->content_type]);
     $query->andFilterWhere(['takonomy_id' => $takonomy]);
     $locals = LuLu::getPagedRows($query, ['orderBy' => 'created_at desc', 'pageSize' => 10]);
     $locals['takonomyModel'] = $takonomyModel;
     return $this->render('list_default', $locals);
 }
開發者ID:ruzuojun,項目名稱:lulucms2,代碼行數:11,代碼來源:BaseContentController.php

示例6: actionList

 /**
  * 列表頁
  * @param integer $taxonomy
  * @return \yii\base\string
  */
 public function actionList($taxonomy = -1)
 {
     $query = Content::findPublished(['content_type' => $this->content_type]);
     if (intval($taxonomy) > 0) {
         $query->andFilterWhere(['taxonomy_id' => intval($taxonomy)]);
     }
     $taxonomyModel = $this->taxonomyService->getTaxonomyById($taxonomy);
     LuLu::setViewParam(['taxonomyModel' => $taxonomyModel]);
     $vars = $this->getListVars($taxonomyModel);
     $locals = LuLu::getPagedRows($query, ['orderBy' => 'created_at desc', 'pageSize' => $vars['pageSize']]);
     $locals['taxonomyModel'] = $taxonomyModel;
     $this->layout = $vars['layout'];
     return $this->render($vars['view'], $locals);
 }
開發者ID:martin20140408,項目名稱:lulucms2,代碼行數:19,代碼來源:BaseContentController.php

示例7: actionIndex

 public function actionIndex()
 {
     $taxonomy = LuLu::getGetValue('taxonomy');
     $query = Content::find();
     $query->where(['content_type' => $this->content_type]);
     $query->andFilterWhere(['taxonomy_id' => $taxonomy]);
     if ($taxonomy === null) {
         $taxonomyModel = Taxonomy::findOne(['id' => $taxonomy]);
     } else {
         $taxonomyModel = ['id' => null, 'name' => '所有'];
     }
     $locals = LuLu::getPagedRows($query, ['orderBy' => 'created_at desc', 'pageSize' => 10]);
     $locals['taxonomyModel'] = $taxonomyModel;
     return $this->render('index', $locals);
 }
開發者ID:hucongyang,項目名稱:lulucms2,代碼行數:15,代碼來源:DefaultController.php


注:本文中的source\LuLu::getPagedRows方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。