本文整理匯總了PHP中Dispatcher::setPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dispatcher::setPath方法的具體用法?PHP Dispatcher::setPath怎麽用?PHP Dispatcher::setPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Dispatcher
的用法示例。
在下文中一共展示了Dispatcher::setPath方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: blog_tool_ishome
function blog_tool_ishome()
{
if (BLOG_URL . trim(Dispatcher::setPath(), '/') == BLOG_URL) {
return true;
} else {
return FALSE;
}
}
示例2: isWebIndex
/**
* @des 檢測是否為網站首頁(首頁包括分頁的情況也被認為是首頁)
* @param null
* @return boolean
*/
function isWebIndex()
{
$qString = trim(Dispatcher::setPath(), '/');
return !!(!$qString || preg_match('/^\\?page=\\d+/', $qString) || preg_match('/^page\\/\\d+/', $qString) || preg_match('/^\\?keyword=.*/', $qString));
}
示例3: trim
if ($value['url'] == ROLE_ADMIN && (ROLE == ROLE_ADMIN || ROLE == ROLE_WRITER)) {
?>
<li class="bold"><a href="<?php
echo BLOG_URL;
?>
admin/" class="waves-effect waves-light">管理站點</a></li>
<li class="bold"><a href="<?php
echo BLOG_URL;
?>
admin/?action=logout" class="waves-effect waves-light">退出</a></li>
<?php
continue;
}
$newtab = $value['newtab'] == 'y' ? 'target="_blank"' : '';
$value['url'] = $value['isdefault'] == 'y' ? BLOG_URL . $value['url'] : trim($value['url'], '/');
$current_tab = BLOG_URL . trim(Dispatcher::setPath(), '/') == $value['url'] ? 'active' : '';
?>
<?php
if (!empty($value['children'])) {
?>
<li class="no-padding">
<ul class="collapsible collapsible-accordion">
<li class="bold">
<a class="collapsible-header waves-effect waves-light"><?php
echo $value['naviname'];
?>
</a>
<div class="collapsible-body">
<ul>
<?php
foreach ($value['children'] as $row) {
示例4: blog_navi
function blog_navi()
{
global $CACHE;
$navi_cache = $CACHE->readCache('navi');
?>
<ul>
<?php
foreach ($navi_cache as $value) {
if ($value['url'] == 'admin' && (ROLE == 'admin' || ROLE == 'writer')) {
?>
<li class="common"><a href="<?php
echo BLOG_URL;
?>
admin/write_log.php">寫日誌</a></li>
<li class="common"><a href="<?php
echo BLOG_URL;
?>
admin/">管理站點</a></li>
<li class="common"><a href="<?php
echo BLOG_URL;
?>
admin/?action=logout">退出</a></li>
<?php
continue;
}
$newtab = $value['newtab'] == 'y' ? 'target="_blank"' : '';
$value['url'] = $value['isdefault'] == 'y' ? BLOG_URL . $value['url'] : trim($value['url'], '/');
$current_tab = BLOG_URL . trim(Dispatcher::setPath(), '/') == $value['url'] ? 'current' : 'common';
?>
<li class="<?php
echo $current_tab;
?>
"><a href="<?php
echo $value['url'];
?>
" <?php
echo $newtab;
?>
><?php
echo $value['naviname'];
?>
</a></li>
<?php
}
?>
</ul>
<?php
}