本文整理汇总了PHP中NewsfeedsHelperRoute::getCategoryRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsfeedsHelperRoute::getCategoryRoute方法的具体用法?PHP NewsfeedsHelperRoute::getCategoryRoute怎么用?PHP NewsfeedsHelperRoute::getCategoryRoute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsfeedsHelperRoute
的用法示例。
在下文中一共展示了NewsfeedsHelperRoute::getCategoryRoute方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareDocument
/**
* Prepares the document
*
* @return void
*/
protected function prepareDocument()
{
parent::prepareDocument();
$menu = $this->menu;
$id = (int) @$menu->query['id'];
if ($menu && ($menu->query['option'] != 'com_newsfeeds' || $menu->query['view'] == 'newsfeed' || $id != $this->category->id)) {
$path = array(array('title' => $this->category->title, 'link' => ''));
$category = $this->category->getParent();
while (($menu->query['option'] != 'com_newsfeeds' || $menu->query['view'] == 'newsfeed' || $id != $category->id) && $category->id > 1) {
$path[] = array('title' => $category->title, 'link' => NewsfeedsHelperRoute::getCategoryRoute($category->id));
$category = $category->getParent();
}
$path = array_reverse($path);
foreach ($path as $item) {
$this->pathway->addItem($item['title'], $item['link']);
}
}
}
示例2: defined
defined('_JEXEC') or die;
?>
<?php
if (count($this->children[$this->category->id]) > 0 && $this->maxLevel != 0) {
?>
<ul>
<?php
foreach ($this->children[$this->category->id] as $id => $child) {
?>
<?php
if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) {
?>
<li>
<a href="<?php
echo JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($child->id));
?>
"><?php
echo $this->escape($child->title);
?>
</a>
<?php
if ($this->params->get('show_cat_items') == 1) {
?>
<small>(<?php
echo $child->numitems;
?>
)</small>
<?php
}
示例3:
?>
<?php
if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) {
if (!isset($this->items[$this->parent->id][$id + 1])) {
$class = ' class="last"';
}
?>
<li<?php
echo $class;
?>
>
<?php
$class = '';
?>
<span class="item-title"><a href="<?php
echo JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($item->id));
?>
">
<?php
echo $this->escape($item->title);
?>
</a>
</span>
<?php
if ($this->params->get('show_subcat_desc_cat') == 1) {
?>
<?php
if ($item->description) {
?>
<div class="category-desc">
<?php
示例4: _prepareDocument
/**
* Prepares the document
*
* @return void
*
* @since 1.6
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$pathway = $app->getPathway();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
} else {
$this->params->def('page_heading', JText::_('COM_NEWSFEEDS_DEFAULT_PAGE_TITLE'));
}
$title = $this->params->get('page_title', '');
$id = (int) @$menu->query['id'];
// If the menu item does not concern this newsfeed
if ($menu && ($menu->query['option'] != 'com_newsfeeds' || $menu->query['view'] != 'newsfeed' || $id != $this->item->id)) {
// If this is not a single newsfeed menu item, set the page title to the newsfeed title
if ($this->item->name) {
$title = $this->item->name;
}
$path = array(array('title' => $this->item->name, 'link' => ''));
$category = JCategories::getInstance('Newsfeeds')->get($this->item->catid);
while (($menu->query['option'] != 'com_newsfeeds' || $menu->query['view'] == 'newsfeed' || $id != $category->id) && $category->id > 1) {
$path[] = array('title' => $category->title, 'link' => NewsfeedsHelperRoute::getCategoryRoute($category->id));
$category = $category->getParent();
}
$path = array_reverse($path);
foreach ($path as $item) {
$pathway->addItem($item['title'], $item['link']);
}
}
if (empty($title)) {
$title = $app->get('sitename');
} elseif ($app->get('sitename_pagetitles', 0) == 1) {
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
} elseif ($app->get('sitename_pagetitles', 0) == 2) {
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
if (empty($title)) {
$title = $this->item->name;
}
$this->document->setTitle($title);
if ($this->item->metadesc) {
$this->document->setDescription($this->item->metadesc);
} elseif ($this->params->get('menu-meta_description')) {
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->item->metakey) {
$this->document->setMetadata('keywords', $this->item->metakey);
} elseif ($this->params->get('menu-meta_keywords')) {
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots')) {
$this->document->setMetadata('robots', $this->params->get('robots'));
}
if ($app->get('MetaTitle') == '1') {
$this->document->setMetaData('title', $this->item->name);
}
if ($app->get('MetaAuthor') == '1') {
$this->document->setMetaData('author', $this->item->author);
}
$mdata = $this->item->metadata->toArray();
foreach ($mdata as $k => $v) {
if ($v) {
$this->document->setMetadata($k, $v);
}
}
}
示例5:
?>
<?php
if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) {
if (!isset($this->children[$this->category->id][$id + 1])) {
$class = ' class="last"';
}
?>
<li<?php
echo $class;
?>
>
<?php
$class = '';
?>
<span class="item-title"><a href="<?php
echo Route::url(NewsfeedsHelperRoute::getCategoryRoute($child->id));
?>
">
<?php
echo $this->escape($child->title);
?>
</a>
</span>
<?php
if ($this->params->get('show_subcat_desc') == 1) {
?>
<?php
if ($child->description) {
?>
<div class="category-desc">
示例6: defined
<?php
defined('_JEXEC') or die;
?>
<?php if (count($this->items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) : ?>
<ul>
<?php foreach($this->items[$this->parent->id] as $id => $item) : ?>
<?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : ?>
<li>
<a href="<?php echo JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($item->id));?>"><?php echo $this->escape($item->title); ?></a>
<?php if ($this->params->get('show_cat_items_cat') == 1) : ?>
<small>(<?php echo $item->numitems; ?>)</small>
<?php endif; ?>
<?php if (($this->params->get('show_subcat_desc_cat') == 1) && $item->description) : ?>
<div><?php echo JHtml::_('content.prepare', $item->description, '', 'com_newsfeeds.categories'); ?></div>
<?php endif; ?>
<?php
if (count($item->getChildren()) > 0) {
$this->items[$item->id] = $item->getChildren();
$this->parent = $item;
$this->maxLevelcat--;
echo $this->loadTemplate('items');
$this->parent = $item->getParent();
$this->maxLevelcat++;
}
?>
</li>
示例7:
<?php
if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) {
if (!isset($this->items[$this->parent->id][$id + 1])) {
$class = ' class="last"';
}
?>
<div <?php
echo $class;
?>
>
<?php
$class = '';
?>
<h3 class="page-header item-title">
<a href="<?php
echo JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($item->id, $item->language));
?>
">
<?php
echo $this->escape($item->title);
?>
</a>
<?php
if ($this->params->get('show_cat_items_cat') == 1) {
?>
<span class="badge badge-info tip hasTooltip" title="<?php
echo JHtml::tooltipText('COM_NEWSFEEDS_NUM_ITEMS');
?>
">
<?php
echo JText::_('COM_NEWSFEEDS_NUM_ITEMS');
示例8: _prepareDocument
/**
* Prepares the document
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = \App::get('menu');
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
} else {
$this->params->def('page_heading', Lang::txt('COM_NEWSFEEDS_DEFAULT_PAGE_TITLE'));
}
$id = (int) @$menu->query['id'];
if ($menu && ($menu->query['option'] != 'com_newsfeeds' || $menu->query['view'] == 'newsfeed' || $id != $this->category->id)) {
$path = array(array('title' => $this->category->title, 'link' => ''));
$category = $this->category->getParent();
while (($menu->query['option'] != 'com_newsfeeds' || $menu->query['view'] == 'newsfeed' || $id != $category->id) && $category->id > 1) {
$path[] = array('title' => $category->title, 'link' => NewsfeedsHelperRoute::getCategoryRoute($category->id));
$category = $category->getParent();
}
$path = array_reverse($path);
foreach ($path as $item) {
Pathway::append($item['title'], $item['link']);
}
}
$title = $this->params->get('page_title', '');
if (empty($title)) {
$title = $app->getCfg('sitename');
} elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
$title = Lang::txt('JPAGETITLE', $app->getCfg('sitename'), $title);
} elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
$title = Lang::txt('JPAGETITLE', $title, $app->getCfg('sitename'));
}
$this->document->setTitle($title);
if ($this->category->metadesc) {
$this->document->setDescription($this->category->metadesc);
} elseif (!$this->category->metadesc && $this->params->get('menu-meta_description')) {
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->category->metakey) {
$this->document->setMetadata('keywords', $this->category->metakey);
} elseif (!$this->category->metakey && $this->params->get('menu-meta_keywords')) {
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots')) {
$this->document->setMetadata('robots', $this->params->get('robots'));
}
if ($app->getCfg('MetaAuthor') == '1') {
$this->document->setMetaData('author', $this->category->getMetadata()->get('author'));
}
$mdata = $this->category->getMetadata()->toArray();
foreach ($mdata as $k => $v) {
if ($v) {
$this->document->setMetadata($k, $v);
}
}
}
示例9:
?>
<?php
if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) {
if (!isset($this->items[$this->parent->id][$id + 1])) {
$class = ' class="last"';
}
?>
<li<?php
echo $class;
?>
>
<?php
$class = '';
?>
<span class="item-title"><a href="<?php
echo Route::url(NewsfeedsHelperRoute::getCategoryRoute($item->id));
?>
">
<?php
echo $this->escape($item->title);
?>
</a>
</span>
<?php
if ($this->params->get('show_subcat_desc_cat') == 1) {
?>
<?php
if ($item->description) {
?>
<div class="category-desc">
<?php