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


PHP Paginator::getFirstLimit方法代码示例

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


在下文中一共展示了Paginator::getFirstLimit方法的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::getFirstLimit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。