本文整理汇总了PHP中Enlight_Event_EventArgs::getParams方法的典型用法代码示例。如果您正苦于以下问题:PHP Enlight_Event_EventArgs::getParams方法的具体用法?PHP Enlight_Event_EventArgs::getParams怎么用?PHP Enlight_Event_EventArgs::getParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Enlight_Event_EventArgs
的用法示例。
在下文中一共展示了Enlight_Event_EventArgs::getParams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAssemble
/**
* Event listener method
*
* @param Enlight_Event_EventArgs $args
*/
public static function onAssemble(Enlight_Event_EventArgs $args)
{
return;
$query = $args->getParams();
if(!empty($query['module']) && $query['module']!='frontend') {
return;
}
if(!empty($query['title'])) {
$title = $query['title'];
} elseif (!empty($query['sViewport']) && $query['sViewport']=='detail') {
$title = Shopware()->Modules()->Articles()->sGetArticleNameByArticleId($query['sArticle']);
} elseif (!empty($query['sViewport']) && $query['sViewport']=='cat') {
$sql = 'SELECT description FROM s_categories WHERE id=?';
$title = Shopware()->Db()->fetchOne($sql, array($query['sCategory']));
}
unset($query['title'], $query['module']);
if(!empty($query['sAction']) && $query['sAction']=='index') {
unset($query['sAction']);
}
if(!empty($query['sViewport']) && $query['sViewport']=='index') {
unset($query['sViewport']);
}
$result = '';
if(!empty($query['sViewport'])) {
switch ($query['sViewport']) {
case 'custom':
$result .= 'unternehmen/';
$parts = array('sViewport', 'sCustom');
break;
case 'detail':
$parts = array('sViewport', 'sArticle', 'sCategory');
break;
case 'cat':
$parts = array('sViewport', 'sCategory', 'sPage');
break;
case 'campaign':
$parts = array('sViewport', 'sCampaign');
break;
case 'search':
if(!empty($query['sSearchMode']) && $query['sSearchMode'] == 'supplier') {
$result .= 'Supplier-'.self::sCleanupPath($query['sSearchText']);
$parts = array('sSearch');
unset($query['sSearchText'], $query['sSearchMode'], $query['sViewport']);
}
break;
default:
break;
}
}
if(!empty($parts)) {
if(!empty($title)) {
$result .= self::sCleanupPath($title);
}
foreach ($parts as $key) {
if(!empty($query[$key])) {
$result .= '_'.$query[$key];
unset($query[$key]);
}
}
$result .= '.html';
if(!empty($query)) {
$result .= '?'.http_build_query($query, '', '&');
}
} elseif(!empty($query)) {
$result .= Shopware()->Config()->BaseFile;
$result .= '/';
if(!empty($query))
{
$result .= http_build_query($query, '', '/');
$result = str_replace('=', ',', $result);
}
}
return $result;
}