本文整理汇总了PHP中Paginator::output方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::output方法的具体用法?PHP Paginator::output怎么用?PHP Paginator::output使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paginator
的用法示例。
在下文中一共展示了Paginator::output方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: leave
public function leave()
{
$smarty = parent::load('smarty');
$leave_form = parent::load('form', 'LeaveForm', $_POST);
parent::load('model', 'forms');
parent::load('model', 'system/contrib/auth.User');
if (!$this->is_post()) {
import('system/share/web/paginator');
if (User::has_role('人力资源') || User::has_role('总经理')) {
$data = Forms::get_by_type_and_user('请假申请');
$smarty->assign('has_role', true);
} else {
$data = Forms::get_by_type_and_user('请假申请', User::info('id'));
}
$paginator = new Paginator((array) $data, $_GET['page'], 10);
$smarty->assign('paginator', $paginator->output());
$smarty->assign('page_title', '请假申请');
$smarty->assign('leave_form', $leave_form->output());
$smarty->display('forms/leave');
return;
}
$form_data = new Forms();
$form_data->user_id = User::info('id');
$form_data->state = 0;
$form_data->type = '请假申请';
$form_data->form_data = serialize($_POST);
$form_data->save();
import('system/share/network/redirect');
HTTPRedirect::flash_to('forms/leave', '提交请假申请成功, 请耐心等待审核', $smarty);
}
示例2: index
public function index($id_or_alias)
{
parent::load('model', 'system/contrib/auth');
parent::load('model', 'articles');
$articles = Article::get_by_category($id_or_alias);
import('system/share/web/paginator');
$paginator = new Paginator($articles, $_GET['page'], 10);
$category = CategoryTable::getInstance()->findByAlias($id_or_alias);
$smarty = parent::load('smarty');
$smarty->assign('category', $category[0]);
$smarty->assign('paginator', $paginator->output());
$smarty->assign('page_title', $category[0]->name);
$smarty->display('article/list');
}
示例3: ls
public function ls($workflow = null, $mix = false, $orders = null)
{
$smarty = parent::load('smarty');
$userinfo = User::info();
/*
* 缓存ID
*/
$cache_id = sprintf('order_list_%s_%s_%s', $workflow, $_GET['page'], User::info('id'));
/*
* 订单导航
*/
$_navigation = Workflow::get_navigation($userinfo);
if (!$workflow) {
if ($_navigation[0]['alias'] == '录入订单') {
$action = $_navigation[1]['action'];
} else {
$action = $_navigation[0]['action'];
}
HTTPRedirect::to($action);
}
if (!$workflow instanceof Workflow) {
$workflow = Workflow::get_by_id($workflow);
}
$smarty->assign('page_title', $workflow->name);
/*
* 当前工作流程是否允许当前用户查看
*/
$role_ids = array_filter(explode(',', $workflow->roles));
AuthPlugins::required($this, $role_ids);
/*
* 当前导航
*/
foreach ($_navigation as $nav) {
if ($nav['id'] == $workflow->id) {
$navigation[$nav['id']]['active'] = true;
}
$navigation[$nav['id']] = $nav;
}
$smarty->assign('page_title', $navigation[$workflow->id]['name']);
$smarty->assign('active_workflow', $workflow->id);
$smarty->assign('order_navigation', $navigation);
/*
* 获取工作流程中, 当前的可操作选项
*/
$operation = Workflow::get_operation($workflow->sequence, User::info());
$smarty->assign('operations', $operation);
$smarty->assign('workflow', $workflow);
if (!$mix) {
if (method_exists('OrderController', 'order_list_custom_' . $workflow)) {
$method_name = 'order_list_custom_' . $workflow->id;
$orders = $this->{$method_name}($workflow->id);
} else {
/*
* 订单列表
*/
if (count($workflow->Children) > 0) {
$get_by_id = array();
foreach ($workflow->Children as $child) {
$get_by_id[] = $child->id;
}
$get_by_id[] = $workflow->id;
} else {
$get_by_id = $workflow->id;
}
/*
* 在跟进订单之后 只显示当前用户所有的
*/
if ($workflow->id > 2 && !User::has_role('总经理')) {
$orders = Order::get_list($get_by_id, $userinfo['id'], $userinfo['role'][0]['alias']);
} else {
$orders = Order::get_list($get_by_id);
}
}
if (User::has_role('技术经理')) {
$operation[] = array('label' => '分配任务', 'action' => 'order/select_designer');
}
}
/*
* 分页
*/
import('system/share/web/paginator');
$paginator = new Paginator($orders, $_GET['page'], 10);
$smarty->assign('paginator', $paginator->output());
/*
* 是否客服
*/
if (User::has_role('客服')) {
$smarty->assign('is_customer_service', true);
}
/*
* 尝试显示对应操作的模板
*/
try {
if ($workflow->template) {
$tpl = $workflow->template;
} else {
$tpl = str_replace('order/list/', 'order/list_', $navigation[$workflow->id]['action']);
}
$smarty->display($tpl);
} catch (DoesNotExistsException $e) {
//.........这里部分代码省略.........
示例4: workflow_permission
public function workflow_permission()
{
parent::load('model', 'workflow');
parent::load('model', 'order');
parent::load('model', 'system/contrib/auth');
$workflows = WorkflowTable::getInstance()->findAll();
$roles = RoleTable::getInstance()->findAll();
$roles_cleaned = array();
foreach ($roles as $role) {
$roles_cleaned[$role['id']] = $role['name'];
}
foreach ($workflows as $k => $workflow) {
$_roles = array_filter(explode(',', $workflow->roles));
$workflows[$k]->roles = '';
if ($_roles) {
foreach ($_roles as $_r) {
$workflows[$k]->roles .= ' ' . $roles_cleaned[$_r];
}
}
}
import('system/share/web/paginator');
$paginator = new Paginator($workflows, $_GET['page'], 20);
$this->smarty->assign('paginator', $paginator->output());
$this->smarty->display('manager/order/workflow_list');
}