I have the code bellow:
<?= Html::dropDownList('application',
Yii::$app->session->get('user.application')->id,
Yii::$app->session->get('user.cliente')->getAllDataListAplicacaos(),
['id' => 'application', 'class' => 'form-control']); ?>
And the yii create a simple select. How do it like the bootstrap dropdown button? http://getbootstrap.com/components/#btn-dropdowns
I am trying that way:
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-refresh"></span>
<?php echo Yii::t('app','Choose application'); ?> <span class="caret"></span>
</button>
<ul class="dropdown-menu" id="application">
<?php foreach($listApplicacoes as $key => $value): ?>
<li><a href="#" data-method="post" data-params="<?php echo $key; ?>"><?php echo $value; ?></a></li>
<?php endforeach ?>
</ul>
</div>
but form dont send data to controller
<?= Html::beginForm(['/site/choose-application'],'post',['id' => 'form-choose-app'])?>