本文整理匯總了PHP中Gdn_Url::request方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gdn_Url::request方法的具體用法?PHP Gdn_Url::request怎麽用?PHP Gdn_Url::request使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gdn_Url
的用法示例。
在下文中一共展示了Gdn_Url::request方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: debug
* default config and the general and error functions. More control is possible
* here, but some things have already been loaded and are immutable.
*/
if (file_exists(PATH_CONF . '/bootstrap.early.php')) {
require_once PATH_CONF . '/bootstrap.early.php';
}
Gdn::config()->caching(true);
debug(c('Debug', false));
setHandlers();
/**
* Installer Redirect
*
* If Garden is not yet installed, force the request to /dashboard/setup and
* begin installation.
*/
if (Gdn::config('Garden.Installed', false) === false && strpos(Gdn_Url::request(), 'setup') === false) {
safeHeader('Location: ' . Gdn::request()->url('dashboard/setup', true));
exit;
}
/**
* Extension Managers
*
* Now load the Addon, Application, Theme and Plugin managers into the Factory, and
* process the application-specific configuration defaults.
*/
// ApplicationManager
Gdn::factoryInstall(Gdn::AliasApplicationManager, 'Gdn_ApplicationManager', '', Gdn::FactorySingleton, [Gdn::addonManager()]);
// ThemeManager
Gdn::factoryInstall(Gdn::AliasThemeManager, 'Gdn_ThemeManager', '', Gdn::FactorySingleton, [Gdn::addonManager()]);
// PluginManager
Gdn::factoryInstall(Gdn::AliasPluginManager, 'Gdn_PluginManager', '', Gdn::FactorySingleton, [Gdn::addonManager()]);
示例2: isActive
/**
* Checks whether the current request url matches an item's link url.
*
* @param array $item The item to check.
* @return bool Whether the current request url matches an item's link url.
*/
protected function isActive($item)
{
if (empty($this->highlightRoute)) {
$highlightRoute = Gdn_Url::request(true);
} else {
$highlightRoute = url($this->highlightRoute);
}
return val('url', $item) && trim(url(val('url', $item)), '/') == trim($highlightRoute, '/');
}
示例3: isActive
/**
* Checks whether the current request url matches an item's link url.
*
* @param array $item The item to check.
* @return bool Whether the current request url matches an item's link url.
*/
public function isActive($item)
{
$highlightRoute = Gdn_Url::request();
$highlightUrl = Url($highlightRoute);
return val('linkUrl', $item) && Url(val('linkUrl', $item)) == $highlightUrl;
}