本文整理匯總了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()