本文整理汇总了PHP中aTools::isPageCached方法的典型用法代码示例。如果您正苦于以下问题:PHP aTools::isPageCached方法的具体用法?PHP aTools::isPageCached怎么用?PHP aTools::isPageCached使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aTools
的用法示例。
在下文中一共展示了aTools::isPageCached方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCachedPage
/**
* Access to pages cached with cacheVirtualPages and cacheVirtualPage and
* implicitly cached by earlier slot insertions for a virtual page
* @param string $slug
* @return aPage
*/
public static function getCachedPage($slug)
{
if (aTools::isPageCached($slug)) {
return aTools::$globalCache[$slug];
} else {
return null;
}
}
示例2: getTitle
public function getTitle()
{
// See if the index action has already cached the associated page
// (This is a big speedup)
$slug = $this->getVirtualPageSlug();
if (aTools::isPageCached($slug)) {
$titleSlot = aTools::getCachedPage($slug)->getSlot('title');
} else {
$titleSlot = $this->Page->getSlot('title');
}
if ($titleSlot) {
$result = $titleSlot->value;
} else {
$result = $this['slug'];
}
$title = trim($result);
if (!strlen($result)) {
// Don't break the UI, return something reasonable
$slug = $this->slug;
$title = substr(strrchr($slug, "/"), 1);
}
return $title;
}