本文整理汇总了PHP中PageManager::fetchTitleFromHandle方法的典型用法代码示例。如果您正苦于以下问题:PHP PageManager::fetchTitleFromHandle方法的具体用法?PHP PageManager::fetchTitleFromHandle怎么用?PHP PageManager::fetchTitleFromHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageManager
的用法示例。
在下文中一共展示了PageManager::fetchTitleFromHandle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertBreadcrumbsUsingPageIdentifier
public function insertBreadcrumbsUsingPageIdentifier($page_id, $preserve_last = true)
{
if ($page_id == 0) {
return parent::insertBreadcrumbs(array(Widget::Anchor(__('Pages'), SYMPHONY_URL . '/blueprints/pages/')));
}
$pages = PageManager::resolvePage($page_id, 'handle');
foreach ($pages as &$page) {
// If we are viewing the Page Editor, the Breadcrumbs should link
// to the parent's Page Editor.
if ($this->_context[0] == 'edit') {
$page = Widget::Anchor(PageManager::fetchTitleFromHandle($page), SYMPHONY_URL . '/blueprints/pages/edit/' . PageManager::fetchIDFromHandle($page) . '/');
// If the pages index is nested, the Breadcrumb should link to the
// Pages Index filtered by parent
} elseif (Symphony::Configuration()->get('pages_table_nest_children', 'symphony') == 'yes') {
$page = Widget::Anchor(PageManager::fetchTitleFromHandle($page), SYMPHONY_URL . '/blueprints/pages/?parent=' . PageManager::fetchIDFromHandle($page));
// If there is no nesting on the Pages Index, the breadcrumb is
// not a link, just plain text
} else {
$page = new XMLElement('span', PageManager::fetchTitleFromHandle($page));
}
}
if (!$preserve_last) {
array_pop($pages);
}
parent::insertBreadcrumbs(array_merge(array(Widget::Anchor(__('Pages'), SYMPHONY_URL . '/blueprints/pages/')), $pages));
}
示例2: listAllPages
public function listAllPages($separator = '/')
{
$pages = PageManager::fetch(false, array('id', 'handle', 'title', 'path'));
foreach ($pages as &$page) {
$parents = explode('/', $page['path']);
foreach ($parents as &$parent) {
$parent = PageManager::fetchTitleFromHandle($parent);
}
$parents = implode($separator, $parents);
$page['title'] = $parents ? $parents . $separator . $page['title'] : $page['title'];
}
return $pages;
}