我有 2 个参数: filter_town_id filter_transaction_type
我想获得菜单 ID 相同的参数
现在我使用循环,但我认为这是最好的解决方案。
$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);