在以下代碼中,您看到product/new
路線的標籤爲new
,product/index
路線的標籤爲popular
。我無法弄清楚這些標籤是用來做什麼的,即使我刪除它們,我也看不到html輸出有什麼不同。Yii框架CMenu中使用的標籤是什麼?
$this->widget('zii.widgets.CMenu', array(
'items'=>array(
// Important: you need to specify url as 'controller/action',
// not just as 'controller' even if default acion is used.
array('label'=>'Home', 'url'=>array('site/index')),
array('label'=>'Products', 'url'=>array('product/index'), 'items'=>array(
array('label'=>'New Arrivals', 'url'=>array('product/new', 'tag'=>'new')),
array('label'=>'Most Popular', 'url'=>array('product/index', 'tag'=>'popular')),
)),
array('label'=>'Login', 'url'=>array('site/login'), 'visible'=>Yii::app()->user->isGuest),
),
));
非常感謝。我從來沒有想過它被用於查詢字符串。 – bobo 2011-12-28 04:51:53