本文整理汇总了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;
}