本文整理匯總了PHP中Reg::tplSet方法的典型用法代碼示例。如果您正苦於以下問題:PHP Reg::tplSet方法的具體用法?PHP Reg::tplSet怎麽用?PHP Reg::tplSet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Reg
的用法示例。
在下文中一共展示了Reg::tplSet方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: paginate
function paginate($page, $total, $itemsPerPage, $paginationName = 'pagination')
{
if (empty($page) || !is_numeric($page)) {
$page = 1;
}
$totalPage = ceil($total / $itemsPerPage);
$prevPage = $page > 1 ? $page - 1 : '';
$nextPage = $page < $totalPage ? $page + 1 : '';
$pagination = array('page' => $page, 'prevPage' => $prevPage, 'nextPage' => $nextPage, 'total' => $total, 'itemPerPage' => $itemsPerPage, 'totalPage' => $totalPage);
Reg::tplSet($paginationName, $pagination);
return 'LIMIT ' . ($page - 1) * $itemsPerPage . ', ' . $itemsPerPage;
}
示例2: requiredData
public static function requiredData($requiredData)
{
$data = array();
if (empty($requiredData)) {
return $data;
}
Reg::tplSet('sitesData', self::getSites());
foreach ($requiredData as $action => $args) {
if (method_exists('panelRequestManager', $action)) {
if ($action == 'getSitesUpdates') {
$data[$action] = self::$action($GLOBALS['userID']);
} else {
$data[$action] = self::$action($args);
}
} elseif (in_array($action, self::$addonFunctions) && function_exists($action)) {
$data[$action] = call_user_func($action, $args);
} elseif (strpos($action, '::') !== false && in_array($action, self::$addonFunctions)) {
$tempMethod = explode('::', $action);
if (method_exists($tempMethod[0], $tempMethod[1])) {
$data[$action] = call_user_func($action, $args);
}
}
}
return $data;
}