本文整理匯總了PHP中Institution::countAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Institution::countAll方法的具體用法?PHP Institution::countAll怎麽用?PHP Institution::countAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Institution
的用法示例。
在下文中一共展示了Institution::countAll方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
<?php
$page = isset($_GET['page']) ? $_GET['page'] : 1;
if (!preg_match('/^\\d+$/', $page)) {
dispatch('core/backend/404');
exit;
}
$objects = Institution::findAll();
$html = new HTML();
$html->renderOut('core/backend/html_header', array('title' => i18n(array('en' => 'Institution', 'zh' => '教育院校'))), true);
$html->output('<div id="wrapper">');
$html->renderOut('core/backend/header');
$perpage = 50;
$total = Institution::countAll();
$total_page = ceil($total / $perpage);
$html->renderOut('institution/backend/institution_list', array('objects' => Institution::findAllWithPage($page, $perpage), 'current_page' => $page, 'total_page' => $total_page, 'total' => $total, 'pager' => $html->render('core/components/pagination', array('total' => $total_page, 'page' => $page)), 'start_entry' => ($page - 1) * $perpage + 1, 'end_entry' => min(array($total, $page * $perpage))), true);
$html->output('</div>');
$html->renderOut('core/backend/html_footer');
exit;