本文整理汇总了PHP中ContentHelperRoute::_findItem方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentHelperRoute::_findItem方法的具体用法?PHP ContentHelperRoute::_findItem怎么用?PHP ContentHelperRoute::_findItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentHelperRoute
的用法示例。
在下文中一共展示了ContentHelperRoute::_findItem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCategoryRoute
function getCategoryRoute($catid, $sectionid)
{
$needles = array('category' => (int) $catid, 'section' => (int) $sectionid);
//Create the link
$link = 'index.php?option=com_content&view=category&id=' . $catid;
if ($item = ContentHelperRoute::_findItem($needles)) {
if (isset($item->query['layout'])) {
$link .= '&layout=' . $item->query['layout'];
}
$link .= '&Itemid=' . $item->id;
}
return $link;
}
示例2: getCategoryRoute
public static function getCategoryRoute($catid)
{
jimport('joomla.application.categories');
$categoryTree = JCategories::getInstance('com_content');
$category = $categoryTree->get($catid);
$catids = array();
$catids[] = $category->id;
while ($category->getParent() instanceof JCategoryNode) {
$category = $category->getParent();
$catids[] = $category->id;
}
$catids = array_reverse($catids);
$needles = array('category' => $catids);
$category = $categoryTree->get($catid);
//Create the link
$link = 'index.php?option=com_content&view=category&id=' . $category->slug;
if ($item = ContentHelperRoute::_findItem($needles)) {
if (isset($item->query['layout'])) {
$link .= '&layout=' . $item->query['layout'];
}
$link .= '&Itemid=' . $item->id;
}
return $link;
}
示例3: getItemid
/**
* Deprecated, use ContentHelper::getItemid instead.
*
* @since 1.0
* @deprecated As of version 1.5
* @see ContentHelperRoute::getArticleRoute()
*/
function getItemid($id)
{
require_once JPATH_SITE . DS . 'components' . DS . 'com_content' . DS . 'helpers' . DS . 'route.php';
// Load the article data to know what section/category it is in.
$article =& JTable::getInstance('content');
$article->load($id);
$needles = array('article' => (int) $id, 'category' => (int) $article->catid, 'section' => (int) $article->sectionid);
$item = ContentHelperRoute::_findItem($needles);
$return = is_object($item) ? $item->id : null;
return $return;
}
示例4: _findItemExt
public static function _findItemExt($needles = null)
{
return parent::_findItem($needles);
}