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


PHP Model_Category::count方法代码示例

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


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

示例1: action_index

 public function action_index()
 {
     // Pagination
     $config = array('pagination_url' => \Uri::current(), 'total_items' => Model_Category::count(), 'per_page' => 3, 'uri_segment' => 'page');
     $pagination = \Pagination::forge('categories_pagination', $config);
     // Get categorys
     $this->data['categories'] = Model_Category::query()->offset($pagination->offset)->limit($pagination->per_page)->order_by('created_at', 'DESC')->get();
     return \Response::forge(\View::forge('frontend/category/index')->set($this->data, null, false));
 }
开发者ID:daniel-rodas,项目名称:rodasnet.com,代码行数:9,代码来源:category.php

示例2: action_index

 public function action_index()
 {
     $this->dataGlobal['pageTitle'] = __('backend.category.manage');
     $per_page = floor(Model_Category::count() / 2);
     // Pagination
     $config = array('pagination_url' => \Uri::current(), 'total_items' => Model_Category::count(), 'per_page' => $per_page, 'uri_segment' => 'page');
     $this->data['pagination'] = $pagination = \Pagination::forge('category_pagination', $config);
     // Get categories
     $this->data['categories'] = Model_Category::query()->offset($pagination->offset)->limit($pagination->per_page)->order_by('created_at', 'DESC')->get();
     return \Response::forge(\View::forge('backend/category/index')->set($this->data, null, false));
 }
开发者ID:daniel-rodas,项目名称:rodasnet.com,代码行数:11,代码来源:category.php


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