本文整理匯總了PHP中Companies::paginateActive方法的典型用法代碼示例。如果您正苦於以下問題:PHP Companies::paginateActive方法的具體用法?PHP Companies::paginateActive怎麽用?PHP Companies::paginateActive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Companies
的用法示例。
在下文中一共展示了Companies::paginateActive方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
/**
* Show companies index page
*
* @param void
* @return null
*/
function index()
{
if ($this->request->isApiCall()) {
$this->serveData(Companies::findByIds($this->logged_user->visibleCompanyIds()), 'companies');
} else {
$page = (int) $this->request->get('page');
if ($page < 1) {
$page = 1;
}
// if
list($companies, $pagination) = Companies::paginateActive($this->logged_user, $page, 30);
$this->smarty->assign(array('companies' => $companies, 'pagination' => $pagination));
}
// if
}
示例2: index
/**
* Company listing
*
*/
function index()
{
$company_ids = $this->logged_user->visibleCompanyIds();
foreach ($company_ids as $k => $v) {
if ($this->owner_company->getId() == $v) {
unset($company_ids[$k]);
break;
}
// if
}
// foreach
$per_page = 50;
$page = (int) $this->request->get('page');
if ($page < 1) {
$page = 1;
}
// if
list($companies, $pagination) = Companies::paginateActive($this->logged_user, $page, $per_page);
$this->smarty->assign(array('companies' => $companies, 'pagination' => $pagination, 'total_pages' => ceil(count($company_ids) / $per_page), 'page_title' => lang('People'), 'pagination_url' => assemble_url('mobile_access_people')));
}