本文整理匯總了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']);
}