本文整理匯總了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);
}