Iam使用CJUI選項卡顯示我的選項卡。我想實現基於條件的顯示基於用戶登錄的選項卡。我有2個用戶管理員和客戶。如果客戶登錄,我需要隱藏一個標籤。由於客戶沒有權限訪問這些數據。Iam使用此方法創建選項卡: -根據Yii中的條件顯示CJUI選項卡
$usertype = Yii::app()->user->getstate('usertype'); // to get the user type
if ($usertype == 'customer') {
// hide $tab4
} else {
// show $tab4
}
$this->widget('zii.widgets.jui.CTab', array(
'tabs' => array(
'Summary' => $this->renderPartial('summary', null, true),
'Portfolio' => $this->renderPartial('portfolio', null, true),
'Contact' => $this->renderPartial('contact', null, true),
$tab4 => $this->renderPartial('team', null, true),
),
如何根據條件顯示/隱藏tab4?
謝謝。這一次救了我的工作 – anu
謝謝你給我投票;) –