im trying to make a dropdown in my nav and im using the CMenu widget from yii, im adding link options, item options but no clue, i also tried to make it without the widget (copying the example on the official page bootstrap) but its also not working, maybe its something with javascript, i still dont know how to use javascript well, im learning it, could use any help?
main layout:
<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<!-- blueprint CSS framework -->
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/dist/css/bootstrap.css">
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>
<body>
<div class="container" id="page">
<div id="header">
<div id="logo"><?php echo CHtml::encode(Yii::app()->name); ?></div>
</div><!-- header -->
<div id="mainmenu">
<?php
$this->widget('zii.widgets.CMenu',array(
'htmlOptions'=>array('class'=>'nav nav-pills'),
'submenuHtmlOptions'=>array('class'=>'dropdown-menu'),
'encodeLabel'=>false,
'items'=>array(
array('label'=>'Home', 'url'=>array('/site/index')),
array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),
array('label'=>'Contact', 'url'=>array('/site/contact')),
array('label'=>'Tools <b class="caret"></b>', 'url'=>array('#'), 'itemOptions'=>array('class'=>'dropdown'), 'linkOptions'=>array('class'=>'dropdown-toggle', 'data-toggle'=>'dropdown'), 'items'=>array(
array('label'=>'tool #1', 'url'=>array('/Tools/index'))
)),
),
));
?>
</div><!-- mainmenu -->
<?php if(isset($this->breadcrumbs)):?>
<?php $this->widget('zii.widgets.CBreadcrumbs', array(
'links'=>$this->breadcrumbs,
)); ?><!-- breadcrumbs -->
<?php endif?>
<?php echo $content; ?>
<div class="clear"></div>
<div id="footer">
Copyright © <?php echo date('Y'); ?> by My Company.<br/>
All Rights Reserved.<br/>
<?php echo Yii::powered(); ?>
</div><!-- footer -->
</div><!-- page -->
<!-- Javascript -->
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/css/dist/js/bootstrap.js"></script>
</body>
</html>
and the output html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<!-- blueprint CSS framework -->
<link rel="stylesheet" type="text/css" href="/misc/css/dist/css/bootstrap.css">
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="/misc/css/ie.css" media="screen, projection" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="/misc/css/main.css" />
<link rel="stylesheet" type="text/css" href="/misc/css/form.css" />
<title>Miscellaneous</title>
</head>
<body>
<div class="container" id="page">
<div id="header">
<div id="logo">Miscellaneous</div>
</div><!-- header -->
<div id="mainmenu">
<ul class="nav nav-pills" id="yw0">
<li class="active"><a href="/misc/site/index.ths">Home</a></li>
<li><a href="/misc/site/page.ths?view=about">About</a></li>
<li><a href="/misc/site/contact.ths">Contact</a></li>
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="/misc/site/#.ths">Tools <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/misc/Tools/index.ths">tool #1</a></li>
</ul>
</li>
</ul> </div><!-- mainmenu -->
<!-- breadcrumbs -->
<div id="content">
<h1>Welcome to <i>Miscellaneous</i></h1>
<p>Congratulations! You have successfully created your Yii application.</p>
<p>You may change the content of this page by modifying the following two files:</p>
<ul>
<li>View file: <code>C:\Users\Oscar\Dropbox\Programacion\Servidor\misc\protected\views\site\index.php</code></li>
<li>Layout file: <code>C:\Users\Oscar\Dropbox\Programacion\Servidor\misc\protected\views\layouts\main.php</code></li>
</ul>
<p>For more details on how to further develop this application, please read
the <a href="http://www.yiiframework.com/doc/">documentation</a>.
Feel free to ask in the <a href="http://www.yiiframework.com/forum/">forum</a>,
should you have any questions.</p>
</div><!-- content -->
<div class="clear"></div>
<div id="footer">
Copyright © 2014 by My Company.<br/>
All Rights Reserved.<br/>
Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a>. </div><!-- footer -->
</div><!-- page -->
<!-- Javascript -->
<script type="text/javascript" src="/misc/css/dist/js/bootstrap.js"></script>
</body>
</html>
i only get the first item "tools" but i dont get the dropdown, i dont even see the submenu, anything im missing?