本文整理汇总了PHP中Uri::getParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Uri::getParam方法的具体用法?PHP Uri::getParam怎么用?PHP Uri::getParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uri
的用法示例。
在下文中一共展示了Uri::getParam方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setCurrentPage
/**
* Setando página atual do sistema:
*
* @access private
*/
private function setCurrentPage()
{
$uri = new Uri();
if ($uri->getParam($this->pageName) == null || $uri->getParam($this->pageName) <= 1) {
$this->actualPage = '1';
} elseif ($uri->getParam($this->pageName) >= $this->totalPages) {
$this->actualPage = $this->totalPages;
} else {
$this->actualPage = $uri->getParam($this->pageName);
}
}
示例2: loadPage
<?php
require_once "config/config.php";
$data = new Data();
$uri = new Uri();
$system = new System();
if (USE_DATABASE) {
$db = new dbHandler();
}
if ($uri->size() != 0) {
$controllerName = $uri->getParam(1);
} else {
$controllerName = DEFAULT_CONTROLLER;
}
if (USE_CACHE) {
$system->load()->cacheFile('cache');
if ($system->cache()->mustRecache($uri->fullUri()) || !file_exists($system->cache()->getFullPath($uri->fullUri()))) {
ob_start();
loadPage();
file_put_contents($system->cache()->getFullPath($uri->fullUri()), ob_get_contents(), FILE_BINARY);
$system->cache()->cached($uri->fullUri());
$system->cache()->save();
ob_end_flush();
} else {
include $system->cache()->getFullPath($uri->fullUri());
}
} else {
loadPage();
}
//-----------------------------------
function loadPage()