當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。