本文整理汇总了PHP中JSFactory::getAliasProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP JSFactory::getAliasProduct方法的具体用法?PHP JSFactory::getAliasProduct怎么用?PHP JSFactory::getAliasProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSFactory
的用法示例。
在下文中一共展示了JSFactory::getAliasProduct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jshoppingParseRoute
function jshoppingParseRoute($segments)
{
$vars = array();
initLoadJoomshoppingLanguageFile();
$reservedFirstAlias = JSFactory::getReservedFirstAlias();
$menu = JFactory::getApplication()->getMenu();
$menuItem = $menu->getActive();
JPluginHelper::importPlugin('jshoppingrouter');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onBeforeParseRoute', array(&$vars, &$segments));
$segments[0] = getSeoSegment($segments[0]);
if (isset($segments[1])) {
$segments[1] = getSeoSegment($segments[1]);
} else {
$segments[1] = "";
}
if (!isset($menuItem->query['controller']) && isset($menuItem->query['view'])) {
$menuItem->query['controller'] = $menuItem->query['view'];
}
if (isset($menuItem->query['controller'])) {
if ($menuItem->query['controller'] == "cart") {
$vars['controller'] = "cart";
$vars['task'] = $segments[0];
$dispatcher->trigger('onAfterParseRoute', array(&$vars, &$segments));
return $vars;
}
if ($menuItem->query['controller'] == "wishlist") {
$vars['controller'] = "wishlist";
$vars['task'] = $segments[0];
$dispatcher->trigger('onAfterParseRoute', array(&$vars, &$segments));
return $vars;
}
if ($menuItem->query['controller'] == "search") {
$vars['controller'] = "search";
$vars['task'] = $segments[0];
$dispatcher->trigger('onAfterParseRoute', array(&$vars, &$segments));
return $vars;
}
if ($menuItem->query['controller'] == "user" && $menuItem->query['task'] == "") {
$vars['controller'] = "user";
$vars['task'] = $segments[0];
$dispatcher->trigger('onAfterParseRoute', array(&$vars, &$segments));
return $vars;
}
if ($menuItem->query['controller'] == "checkout") {
$vars['controller'] = "checkout";
$vars['task'] = $segments[0];
$dispatcher->trigger('onAfterParseRoute', array(&$vars, &$segments));
return $vars;
}
if ($menuItem->query['controller'] == "vendor" && $menuItem->query['task'] == "") {
$vars['controller'] = "vendor";
$vars['task'] = $segments[0];
$dispatcher->trigger('onAfterParseRoute', array(&$vars, &$segments));
return $vars;
}
if ($menuItem->query['controller'] == "content" && $menuItem->query['task'] == "view") {
$vars['controller'] = "content";
$vars['page'] = $segments[0];
$dispatcher->trigger('onAfterParseRoute', array(&$vars, &$segments));
return $vars;
}
if ($menuItem->query['controller'] == "category" && $menuItem->query['category_id'] && $segments[1] == "") {
$prodalias = JSFactory::getAliasProduct();
$product_id = array_search($segments[0], $prodalias, true);
if (!$product_id) {
JError::raiseError(404, _JSHOP_PAGE_NOT_FOUND);
}
$vars['controller'] = "product";
$vars['task'] = "view";
$vars['category_id'] = $menuItem->query['category_id'];
$vars['product_id'] = $product_id;
$dispatcher->trigger('onAfterParseRoute', array(&$vars, &$segments));
return $vars;
}
}
if ($segments[0] && !in_array($segments[0], $reservedFirstAlias)) {
$catalias = JSFactory::getAliasCategory();
$category_id = array_search($segments[0], $catalias, true);
if ($category_id && $segments[1] == "") {
$vars['controller'] = "category";
$vars['task'] = "view";
$vars['category_id'] = $category_id;
$dispatcher->trigger('onAfterParseRoute', array(&$vars, &$segments));
return $vars;
}
if ($category_id && $segments[1] != "") {
$prodalias = JSFactory::getAliasProduct();
$product_id = array_search($segments[1], $prodalias, true);
if (!$product_id) {
JError::raiseError(404, _JSHOP_PAGE_NOT_FOUND);
}
if ($category_id && $product_id) {
$vars['controller'] = "product";
$vars['task'] = "view";
$vars['category_id'] = $category_id;
$vars['product_id'] = $product_id;
$dispatcher->trigger('onAfterParseRoute', array(&$vars, &$segments));
return $vars;
}
//.........这里部分代码省略.........