CMenu 및 twitter 부트 스트랩을 사용하여 yii 프레임 워크로 드롭 다운 메뉴를 만드는 방법. 드롭 다운하지 않고 작업을 수행 할 수 있지만 드롭 다운 내가 붙어 있습니까?yii 프레임 워크 및 트위터 부트 스트랩이있는 드롭 다운 메뉴
http://yiistrap.blogspot.in/2013/07/yii-framework-with-twitter-bootstrap-in.html
CMenu 및 twitter 부트 스트랩을 사용하여 yii 프레임 워크로 드롭 다운 메뉴를 만드는 방법. 드롭 다운하지 않고 작업을 수행 할 수 있지만 드롭 다운 내가 붙어 있습니까?yii 프레임 워크 및 트위터 부트 스트랩이있는 드롭 다운 메뉴
http://yiistrap.blogspot.in/2013/07/yii-framework-with-twitter-bootstrap-in.html
당신은 또한 부트 스트랩
$this->widget('bootstrap.widgets.TbButtonGroup', array(
'type' => 'primary', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
'buttons' => array(
array('label' => 'Action', 'url' => '#'), // this makes it split :)
array('items' => array(
array('label' => 'Action', 'url' => '#'),
array('label' => 'Another action', 'url' => '#'),
array('label' => 'Something else', 'url' => '#'),
array('label' => 'Separate link', 'url' => '#'),
)),
),
))에서 버튼의 드롭 다운 메뉴를 사용할 수 있습니다;
또는 Navbar의 메뉴에서이 같은 하위 메뉴를 추가 할 수 있습니다 ..
array('label'=>'First Link', 'url'=>"#", 'itemOptions'=>array('id' => 'xyz'))
이 내가
다음과 같은 설정 (모델 이름 TblUser입니다) 사용자 테이블이 구문 http://www.cniska.net/yii-bootstrap/ <div class="btn-toolbar">
<?php
$this->widget('bootstrap.widgets.TbButtonGroup', array(
'type' => 'primary',
'buttons' => array(
array('label' => 'Action', 'items' => array(
array('label' => 'Action', 'url' => '#'),
array('label' => 'Another action', 'url' => '#'),
array('label' => 'Something else', 'url' => '#'),
array('label' => 'Separate link', 'url' => '#'),
)),
),
));
?>
</div>
기본이다
예 :
사용자 목록을 드롭 다운으로 표시하고 싶을 때 링크를 선택하면 해당 사용자 프로필로 이동해야합니다.
<?php
$usersAry = CHtml::listData(TblUser::model()->findAll(array('order' => 'id')), 'id', 'username');
//$usersAry comes with id as key and username as value
//echo "<pre>";
//print_r($usersAry);
//echo "</pre>";
$items=array();
foreach ($usersAry as $userId=>$user)
{
$items[]=array('label'=>$user,'url'=>'/user/view/'.$userId);
}
?>
<div class="btn-toolbar">
<?php
$this->widget('bootstrap.widgets.TbButtonGroup', array(
'type' => 'primary',
'buttons' => array(
array('label' => 'User List', 'items' => $items),
),
));
?>
</div>