当前位置: 首页>>代码示例>>PHP>>正文


PHP AppController::paginate方法代码示例

本文整理汇总了PHP中AppController::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::paginate方法的具体用法?PHP AppController::paginate怎么用?PHP AppController::paginate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppController的用法示例。


在下文中一共展示了AppController::paginate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: paginate

 /**
  * Overrides Controller::paginate() to set paging options in the
  * Model::paginate property so they available in the Model::paginateCount()
  * method. This is necessary due to the nature of having to paginate over a
  * web service result set rather than a database result set.
  *
  * @param mixed $object
  * @param mixed $scope
  * @param mixed $whitelist
  * @return array The result set
  */
 public function paginate($object = null, $scope = array(), $whitelist = array())
 {
     // Manually put page, show & sort & direction params from URL if present in
     // Controller::paginate
     if (isset($this->passedArgs['page'])) {
         $this->paginate['page'] = $this->passedArgs['page'];
     }
     if (isset($this->passedArgs['show'])) {
         $this->paginate['limit'] = $this->passedArgs['show'];
     }
     if (isset($this->passedArgs['sort'])) {
         $this->paginate['order'] = $this->passedArgs['sort'];
         if (isset($this->passedArgs['direction'])) {
             $this->paginate['order'] .= ' ' . $this->passedArgs['direction'];
         }
     }
     // Merges the Controller::paginate paging params with the
     // Controller::paginate[Model] paging params if present
     $options = $this->paginate;
     if (isset($options[$object])) {
         $options = array_merge($options, $options[$object]);
         unset($options[$object]);
     }
     // Set the merged paging options in the Model::paginate property, so they
     // are available in Model::paginateCount() & Model::paginate() methods which
     // handle pagination of a result set from the web service
     $this->{$object}->paginate = $this->paginate[$object] = $options;
     return parent::paginate($object, $scope, $whitelist);
 }
开发者ID:neilcrookes,项目名称:CakePHP-GData-Plugin,代码行数:40,代码来源:gdata_app_controller.php

示例2: paginate

 /**
  * Overrides Controller::paginate() to set paging options in the
  * Model::paginate property so they available in the Model::paginateCount()
  * method.
  *
  * @param mixed $object
  * @param mixed $scope
  * @param mixed $whitelist
  * @return array The result set
  */
 public function paginate($object = null, $scope = array(), $whitelist = array())
 {
     if (isset($this->passedArgs['page'])) {
         $this->paginate['page'] = $this->passedArgs['page'];
     }
     if (isset($this->passedArgs['show'])) {
         $this->paginate['limit'] = $this->passedArgs['show'];
     }
     $options = $this->paginate;
     if (isset($options[$object])) {
         $options = array_merge($options, $options[$object]);
         unset($options[$object]);
     }
     $this->{$object}->paginate = $this->paginate[$object] = $options;
     return parent::paginate($object = null, $scope = array(), $whitelist = array());
 }
开发者ID:neilcrookes,项目名称:CakePHP-Yahoo-Geo-Planet-Plugin,代码行数:26,代码来源:yahoo_geo_planet_app_controller.php


注:本文中的AppController::paginate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。