本文整理汇总了PHP中DiscussRouter::getAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP DiscussRouter::getAlias方法的具体用法?PHP DiscussRouter::getAlias怎么用?PHP DiscussRouter::getAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiscussRouter
的用法示例。
在下文中一共展示了DiscussRouter::getAlias方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: EasyDiscussBuildRoute
function EasyDiscussBuildRoute(&$query)
{
$segments = array();
$config = DiscussHelper::getConfig();
if (isset($query['view'])) {
switch ($query['view']) {
case 'post':
// We don't want to include the view for the entry links.
unset($query['view']);
if (isset($query['id'])) {
$segments[] = DiscussRouter::getPostAlias($query['id']);
unset($query['id']);
}
if (isset($query['layout'])) {
$segments[] = $query['layout'];
unset($query['layout']);
}
break;
case 'profile':
$segments[] = $query['view'];
unset($query['view']);
if (isset($query['layout'])) {
$segments[] = $query['layout'];
unset($query['layout']);
}
if (isset($query['id'])) {
$segments[] = DiscussRouter::getUserAlias($query['id']);
unset($query['id']);
}
if (isset($query['category_id'])) {
$aliases = DiscussRouter::getCategoryAliases($query['category_id']);
foreach ($aliases as $alias) {
$segments[] = $alias;
}
unset($query['category_id']);
}
if (isset($query['viewtype'])) {
$segments[] = $query['viewtype'];
unset($query['viewtype']);
}
break;
case 'index':
$segments[] = $query['view'];
unset($query['view']);
if (isset($query['category_id'])) {
$aliases = DiscussRouter::getCategoryAliases($query['category_id']);
foreach ($aliases as $alias) {
$segments[] = $alias;
}
unset($query['category_id']);
}
break;
case 'ask':
$segments[] = $query['view'];
unset($query['view']);
if (isset($query['category'])) {
$aliases = DiscussRouter::getCategoryAliases($query['category']);
foreach ($aliases as $alias) {
$segments[] = $alias;
}
unset($query['category']);
}
break;
case 'points':
$segments[] = $query['view'];
unset($query['view']);
$segments[] = $query['layout'];
unset($query['layout']);
$segments[] = DiscussRouter::getUserAlias($query['id']);
unset($query['id']);
break;
case 'tags':
$segments[] = $query['view'];
unset($query['view']);
if (isset($query['id'])) {
$segments[] = DiscussRouter::getTagAlias($query['id']);
unset($query['id']);
}
break;
case 'users':
$segments[] = $query['view'];
unset($query['view']);
if (isset($query['sorting'])) {
$segments[] = 'latest';
unset($query['sorting']);
}
break;
case 'badges':
$segments[] = $query['view'];
unset($query['view']);
if (isset($query['id'])) {
$segments[] = DiscussRouter::getAlias('badges', $query['id']);
unset($query['id']);
unset($query['layout']);
}
if (isset($query['layout'])) {
$segments[] = $query['layout'];
unset($query['layout']);
}
break;
//.........这里部分代码省略.........
示例2: shAddToGETVarsList
}
if (empty($Itemid)) {
$Itemid = DiscussRouter::getItemId($view);
shAddToGETVarsList('Itemid', $Itemid);
}
$name = shGetComponentPrefix($option);
$name = empty($name) ? getMenuTitle($option, $task, $Itemid, null, $shLangName) : $name;
$name = empty($name) || $name == '/' ? 'discuss' : $name;
$title[] = $name;
if (isset($view) && !empty($view)) {
// Translate the view
$title[] = JText::_('COM_EASYDISCUSS_SH404_VIEW_' . JString::strtoupper($view));
shRemoveFromGETVarsList('view');
}
if ($view == 'categories' && !empty($category_id)) {
$title[] = DiscussRouter::getAlias('category', $category_id);
shRemoveFromGETVarsList('category_id');
// Remove the view since we don't want to set the view.
unset($layout);
shRemoveFromGETVarsList('layout');
}
if (!empty($id)) {
if (!empty($permalink)) {
$title[] = $permalink;
shRemoveFromGETVarsList('id');
}
}
// Category id may be category_id=0 in index view.
if (isset($category_id) && $category_id == 0) {
shRemoveFromGETVarsList('category_id');
}