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


PHP Thread::countAll方法代码示例

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


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

示例1: index

 public function index()
 {
     $page = Param::get('page', self::FIRST_PAGE);
     $sort_method = Param::get('sort', 'created');
     $user_id = get_authenticated_user_id($_SESSION['userid']);
     $pagination = new SimplePagination($page, self::MAX_THREADS_PER_PAGE);
     $threads = Thread::getAll($pagination->start_index - 1, $pagination->count + 1, $sort_method);
     $pagination->checkLastPage($threads);
     Thread::getAttributes($threads, $user_id);
     $trending_threads = Comment::getTrending();
     Thread::getTrendTitle($trending_threads);
     $total = Thread::countAll();
     $pages = ceil($total / self::MAX_THREADS_PER_PAGE);
     $this->set(get_defined_vars());
 }
开发者ID:renzosunico,项目名称:MyClassroom,代码行数:15,代码来源:thread_controller.php

示例2: index

 public function index()
 {
     $page = Param::get('page', 1);
     $filter = Param::get('filter');
     // pagination
     $pagination = new SimplePagination($page, self::THREADS_PERPAGE);
     $threads = Thread::getAll($pagination->start_index - 1, $pagination->count + 1, $filter);
     $pagination->checkLastPage($threads);
     $total = Thread::countAll($filter);
     $pages = ceil($total / self::THREADS_PERPAGE);
     // Get other info for each thread
     foreach ($threads as $thread) {
         $thread->creator = User::getByID($thread->user_id);
         $thread->category = Category::getName($thread->category_id);
         $thread->replies_count = Comment::countAll($thread->id);
     }
     // get other variables needed by the view
     $title = 'All Threads';
     $auth_user = User::getAuthenticated();
     $categories = Category::getAll();
     $trending = Thread::getTrending(self::TRENDING_LIMIT);
     $this->set(get_defined_vars());
 }
开发者ID:rdaitan,项目名称:dc-board,代码行数:23,代码来源:thread_controller.php


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