本文整理汇总了PHP中pagination::set_template方法的典型用法代码示例。如果您正苦于以下问题:PHP pagination::set_template方法的具体用法?PHP pagination::set_template怎么用?PHP pagination::set_template使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pagination
的用法示例。
在下文中一共展示了pagination::set_template方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pagination
/**
* Generate box output
*
* @param array $params Parameters
*/
function generate_output($params)
{
$this->set_template($params);
if (isset($params['max_page'])) {
$max_page = (int) $params['max_page'];
} else {
$max_page = 10;
}
if (isset($params['list']) && is_a($params['list'], 'vivvo_db_list')) {
$paging_params = $params['list']->get_pagination();
$this->pagination = new pagination($paging_params['pg_records_per_page'], $max_page, $paging_params['pg_href']);
$this->pagination->set_template($this->_template);
$this->pagination->generate_pagelist($paging_params['pg_total'], $paging_params['pg_current']);
} elseif (isset($params['list']) && is_a($params['list'], 'vivvo_file_paged_list')) {
$paging_params = $params['list']->get_pagination();
$this->pagination = new pagination($paging_params['pg_records_per_page'], $max_page, $paging_params['pg_href']);
$this->pagination->set_template($this->_template);
$this->pagination->generate_pagelist($paging_params['pg_total'], $paging_params['pg_current']);
} else {
$um = vivvo_lite_site::get_instance()->get_url_manager();
$this->pagination = new pagination($um->get_param('pg_records_per_page'), $max_page, $um->get_param('pg_href'));
$this->pagination->set_template($this->_template);
$this->pagination->generate_pagelist($um->get_param('pg_total'), $um->get_param('pg_current'));
}
if (isset($params['title'])) {
$this->_template->assign('title', $params['title']);
}
$this->_template->assign('box_id', $params['box_id']);
}