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


PHP Package::paginate方法代码示例

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


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

示例1: index

 public function index()
 {
     $this->set_default_side_bar();
     $this->title = 'All Packages';
     Nimble::set_title($this->title);
     $page = isset($_GET['page']) ? $_GET['page'] : NULL;
     switch ($this->format) {
         case 'xml':
             $this->packages = Package::find_all();
             $this->header('Content-Type: text/xml', 200);
             echo $this->packages->to_xml();
             $this->layout = false;
             $this->has_rendered = true;
             break;
         case 'json':
             $this->packages = Package::find_all();
             $this->header('Content-type: application/json', 200);
             echo $this->packages->to_json();
             $this->layout = false;
             $this->has_rendered = true;
             break;
         case 'atom':
             $this->layout = false;
             $this->has_rendered = true;
             break;
         case 'rss':
             $this->layout = false;
             $this->has_rendered = true;
             break;
         default:
             $this->full = true;
             $this->packages = Package::paginate(array('select' => '`packages`.*, AVG(`package_ratings`.`rating`) as rating', 'order' => 'rating DESC', 'per_page' => 20, 'page' => $page, 'joins' => 'LEFT JOIN `package_ratings` on `package_ratings`.`package_id` = `packages`.`id`', 'group' => '`packages`.id'));
             break;
     }
 }
开发者ID:scottdavis,项目名称:pearfarm_channel_server,代码行数:35,代码来源:package_controller.php

示例2: packages

 public function packages()
 {
     $this->data['cycles'] = Cycle::all();
     $this->data['services'] = Service::orderBy('name')->get();
     $this->data['packages'] = Package::paginate(25);
     return $this->layout->content = View::make('packages', $this->data);
 }
开发者ID:jacobDaeHyung,项目名称:PHPLaravelGymManagementSystem,代码行数:7,代码来源:PackagesController.php

示例3: index

 public function index()
 {
     $this->set_default_side_bar();
     $this->title = 'All Packages';
     Nimble::set_title($this->title);
     $page = isset($_GET['page']) ? $_GET['page'] : NULL;
     $this->packages = Package::paginate(array('order' => 'name DESC', 'per_page' => 20, 'page' => $page));
     switch ($this->format) {
         case 'xml':
             $this->header('Content-Type: text/xml', 200);
             echo $this->packages->to_xml(array('include' => array('versions')));
             $this->layout = false;
             $this->has_rendered = true;
             break;
         case 'atom':
             break;
         case 'rss':
             break;
     }
 }
开发者ID:xetorthio,项目名称:pearfarm_channel_server,代码行数:20,代码来源:package_controller.php

示例4: simple_search

 public static function simple_search($value)
 {
     $page = isset($_GET['page']) ? $_GET['page'] : NULL;
     return Package::paginate(array('select' => '`packages`.*, AVG(`package_ratings`.`rating`) as rating', 'order' => 'rating DESC', 'per_page' => 20, 'page' => $page, 'conditions' => NimbleRecord::sanitize(array('name LIKE ?', "%{$value}%")), 'joins' => 'LEFT JOIN `package_ratings` on `package_ratings`.`package_id` = `packages`.`id`', 'group' => '`packages`.id'));
 }
开发者ID:scottdavis,项目名称:pearfarm_channel_server,代码行数:5,代码来源:package_search.php

示例5: simple_search

 public static function simple_search($value)
 {
     $page = isset($_GET['page']) ? $_GET['page'] : NULL;
     return Package::paginate(array('order' => 'updated_at DESC', 'per_page' => 20, 'page' => $page, 'conditions' => NimbleRecord::sanitize(array('name LIKE ?', "%{$value}%"))));
 }
开发者ID:xetorthio,项目名称:pearfarm_channel_server,代码行数:5,代码来源:package_search.php


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