当前位置: 首页>>代码示例>>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;未经允许,请勿转载。