本文整理汇总了PHP中Paginator::setLink方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::setLink方法的具体用法?PHP Paginator::setLink怎么用?PHP Paginator::setLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paginator
的用法示例。
在下文中一共展示了Paginator::setLink方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Paginator
$category_var_name = $id;
$category = get_category_by_var_name($category_var_name);
$category_id = $category['id'];
$type_var_name = $extra;
$type_id = get_type_id_by_varname($type_var_name);
$jobsCount = 0;
if ($type_id) {
$jobsCount = $job->CountJobs($id, $type_id);
} else {
$jobsCount = $job->CountJobs($id);
}
$paginatorLink = BASE_URL . URL_JOBS . "/{$category_var_name}";
if (isset($type_var_name)) {
$paginatorLink .= "/{$type_var_name}";
}
$paginator = new Paginator($jobsCount, JOBS_PER_PAGE, @$_REQUEST['p']);
$paginator->setLink($paginatorLink);
$paginator->paginate();
$firstLimit = $paginator->getFirstLimit();
$lastLimit = $paginator->getLastLimit();
$the_jobs = $job->GetPaginatedJobsForCategory($category_id, $firstLimit, JOBS_PER_PAGE, $type_id);
$smarty->assign("pages", $paginator->pages_link);
$smarty->assign('jobs', $the_jobs);
$smarty->assign('jobs_count', $jobsCount);
$smarty->assign('types', get_types());
$smarty->assign('current_category', $category_var_name);
$smarty->assign('current_category_name', $category['name']);
$smarty->assign('seo_title', $category['title']);
$smarty->assign('seo_desc', $category['description']);
$smarty->assign('seo_keys', $category['keywords']);
$template = 'category.tpl';
示例2: array
<?php
$the_jobs = array();
$jobCount = $job->getInactiveJobCount();
$paginator = new Paginator($jobCount, JOBS_PER_PAGE, @$_REQUEST['p']);
$paginator->setLink(BASE_URL . 'home');
$paginator->paginate();
$firstLimit = $paginator->getFirstLimit();
$lastLimit = $paginator->getLastLimit();
$the_jobs = $job->GetInactiveJobs($firstLimit, JOBS_PER_PAGE);
$smarty->assign("pages", $paginator->pages_link);
$smarty->assign('jobs', $the_jobs);
$template = 'index.tpl';