Joomla从params获取菜单ID

时间:2012-09-14 18:09:34

标签: php joomla

我有2个参数: filter_town_id filter_transaction_type

我想得到菜单id contine相同的参数

现在我使用循环,但我认为这是最好的解决方案。

$menus = &JSite::getMenu();
$filter_town_id=$row->town_id;
$filter_transaction_type=$row->transaction_type;
for ($i=1; ; $i++)
{
    $params = $menus->getParams($i);
    $town = $params->get('filter_town_id');
    $type=$params->get('filter_transaction_type');
    if ($filter_town_id==$town&$filter_transaction_type==$type)
    {
        $itemid=$i;
        break;
    }
}

$ url = JRoute :: _('index.php?option = com_component& view = view& id ='。$ row-> slug。'& Itemid ='。$ itemid);

0 个答案:

没有答案