本文整理匯總了PHP中EasyBlogRouter::getRoutedUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP EasyBlogRouter::getRoutedUrl方法的具體用法?PHP EasyBlogRouter::getRoutedUrl怎麽用?PHP EasyBlogRouter::getRoutedUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類EasyBlogRouter
的用法示例。
在下文中一共展示了EasyBlogRouter::getRoutedUrl方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: display
function display($tmpl = null)
{
$config = EasyBlogHelper::getConfig();
$id = JRequest::getCmd('id', '0');
$category = EasyBlogHelper::getTable('Category', 'Table');
$category->load($id);
// private category shouldn't allow to access.
$privacy = $category->checkPrivacy();
if (!$privacy->allowed) {
return;
}
$catIds = array();
$catIds[] = $category->id;
EasyBlogHelper::accessNestedCategoriesId($category, $catIds);
$model = $this->getModel('Blog');
$posts = $model->getBlogsBy('category', $catIds);
$weever = EasyBlogHelper::getHelper('Weever')->getMainFeed();
$weever->set('description', JText::sprintf('COM_EASYBLOG_FEEDS_CATEGORY_DESC', $this->escape($category->title)));
$weever->set('url', EasyBlogRouter::getRoutedUrl('index.php?option=com_easyblog&view=categories&id=' . $id . '&format=weever', false, true));
$weever->set('thisPage', 1);
$weever->set('lastPage', 1);
if ($posts) {
foreach ($posts as $post) {
$blog = EasyBlogHelper::getTable('Blog');
$blog->load($post->id);
$weever->addChild($blog);
}
}
$weever->toJSON(true, JRequest::getVar('callback'));
}
示例2: getWeeverURL
public function getWeeverURL($url)
{
require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'router.php';
$sef = EasyBlogRouter::isSefEnabled();
$join = $sef ? '?' : '&';
$url = EasyBlogRouter::getRoutedUrl($url, false, true) . $join . 'format=weever';
return $url;
}