本文整理匯總了PHP中Manager::hasNextPathItem方法的典型用法代碼示例。如果您正苦於以下問題:PHP Manager::hasNextPathItem方法的具體用法?PHP Manager::hasNextPathItem怎麽用?PHP Manager::hasNextPathItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Manager
的用法示例。
在下文中一共展示了Manager::hasNextPathItem方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderFile
public function renderFile()
{
//Send Content-Type
$sCharset = Settings::getSetting('encoding', 'browser', 'utf-8');
if ($this->sType === ResourceIncluder::RESOURCE_TYPE_CSS) {
header("Content-Type: text/css;charset={$sCharset}");
} else {
if ($this->sType === ResourceIncluder::RESOURCE_TYPE_JS) {
header("Content-Type: text/javascript;charset={$sCharset}");
}
}
//Find consolidated resources
$aKeys = array();
while (Manager::hasNextPathItem()) {
$aKeys[] = Manager::usePath();
}
$sKey = 'consolidated-output-' . $this->sType . '-' . implode('|', $aKeys);
$oCachingStrategy = clone CachingStrategy::fromConfig('file');
$oCache = new Cache($sKey, 'resource', $oCachingStrategy);
$oItemCachingStrategy = clone $oCachingStrategy;
$oItemCachingStrategy->init(array('key_encode' => null));
$oCache->sendCacheControlHeaders();
if (!$oCache->entryExists(false)) {
foreach ($aKeys as $sItemKey) {
$oItemCache = new Cache($sItemKey, DIRNAME_PRELOAD, $oItemCachingStrategy);
if (!$oItemCache->entryExists(false)) {
throw new Exception("Consolidated resource {$sItemKey} does not exist.");
}
$oCache->setContents($oItemCache->getContentsAsString() . "\n", false, true);
}
}
$oCache->sendCacheControlHeaders();
$oCache->passContents(true);
}
示例2: redirectToLanguage
public static function redirectToLanguage($sLanguageId = null)
{
if ($sLanguageId == null) {
$sLanguageId = Session::language();
}
$oLanguage = LanguageQuery::language($sLanguageId)->findOne();
$sLanguageInPathId = null;
if (Manager::hasNextPathItem()) {
$oLanguageInPath = LanguageQuery::language(Manager::peekNextPathItem(), true)->findOne();
if ($oLanguageInPath && $oLanguageInPath->getIsActive()) {
Manager::usePath();
$sLanguageInPathId = $oLanguageInPath->getId();
}
}
$sManager = Manager::getManagerClassNormalized(null);
if ($sManager::shouldIncludeLanguageInLink()) {
if ($sLanguageInPathId === $sLanguageId) {
return;
}
} else {
if ($sLanguageInPathId === null) {
//Did not include language in link and should not
return;
}
}
self::redirectToManager(Manager::getRequestPath(), $sManager, array(), $oLanguage);
}
示例3: __construct
public function __construct()
{
try {
$this->oRootPage = PagePeer::getRootPage();
} catch (Exception $e) {
$this->oRootPage = self::initializeRootPage();
}
$this->oTreeWidget = new TreeWidgetModule();
$this->oTreeWidget->setDelegate($this);
$this->oTreeWidget->setSetting('init_dnd', true);
$oInitialPage = null;
if (Manager::hasNextPathItem()) {
$oInitialPage = PageQuery::create()->findPk(Manager::usePath());
if ($oInitialPage !== null) {
Session::getSession()->setAttribute('persistent_page_id', $oInitialPage->getId());
}
} else {
if (Session::getSession()->hasAttribute('persistent_page_id')) {
$oInitialPage = PageQuery::create()->findPk(Session::getSession()->getAttribute('persistent_page_id'));
}
}
if ($oInitialPage === null) {
$oInitialPage = $this->oRootPage;
}
$this->addResourceParameter(ResourceIncluder::RESOURCE_TYPE_JS, 'tree_session', $this->oTreeWidget->getSessionKey());
$this->addResourceParameter(ResourceIncluder::RESOURCE_TYPE_JS, 'initial_page_id', $oInitialPage->getId());
$this->addResourceParameter(ResourceIncluder::RESOURCE_TYPE_JS, 'initial_page_tree_left', $oInitialPage->getTreeLeft());
$oResourceIncluder = ResourceIncluder::defaultIncluder();
$oResourceIncluder->addResource('admin/template.css', null, null, array(), ResourceIncluder::PRIORITY_NORMAL, null, true);
}
示例4: __construct
public function __construct()
{
$this->initialize();
if (Manager::hasNextPathItem()) {
$this->sFilePath = Manager::peekNextPathItem();
}
}