當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Paginator::getLastLimit方法代碼示例

本文整理匯總了PHP中Paginator::getLastLimit方法的典型用法代碼示例。如果您正苦於以下問題:PHP Paginator::getLastLimit方法的具體用法?PHP Paginator::getLastLimit怎麽用?PHP Paginator::getLastLimit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Paginator的用法示例。


在下文中一共展示了Paginator::getLastLimit方法的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';
開發者ID:Kuzy,項目名稱:jobberbase,代碼行數:31,代碼來源:page_category.php

示例2: Job

$job = new Job($id);
if ($job->Exists() && $extra != '' && $extra == $job->GetAuth()) {
    $info = $job->GetInfo();
    $url = BASE_URL . URL_JOB . '/' . $id . '/' . $info['url_title'] . '/';
    $app = new JobApplication($id);
    $apps_count = $app->Count();
    $info['applied_count'] = $apps_count;
    $smarty->assign('count_applicants', $apps_count);
    $smarty->assign('job', $info);
    $category = get_category_by_id($info['category_id']);
    // set paginator link
    $paginatorLink = BASE_URL . 'view-applicants/' . $id . '/' . $extra . '/';
    $paginator = new Paginator($apps_count, JOBS_PER_PAGE, @$_REQUEST['p']);
    $paginator->setLink($paginatorLink);
    $paginator->paginate();
    $from = $paginator->getFirstLimit();
    $to = $paginator->getLastLimit();
    // grab all jobs applied
    $the_applicants = $app->getAllForJob($from, JOBS_PER_PAGE);
    $smarty->assign('applicants', $the_applicants);
    // send page links to template
    $smarty->assign('pages', $paginator->pages_link);
    $smarty->assign('seo_title', $translator->translate("jobs.html_title", stripslashes($info['title']), stripslashes($info['company']), SITE_NAME));
    $smarty->assign('cv_path', BASE_URL . FILE_UPLOAD_DIR);
    $smarty->assign('current_category', $category['var_name']);
    $smarty->assign('back_link', BASE_URL . 'manage/' . $id . '/' . $extra . '/');
    $template = 'job-applications.tpl';
} else {
    redirect_to(BASE_URL . URL_JOB . '/' . $id . '/');
    exit;
}
開發者ID:zeamxie,項目名稱:jobberbase,代碼行數:31,代碼來源:page_view_applicants.php


注:本文中的Paginator::getLastLimit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。