public function init() { if ($this->canClose) { BHtml::registerBootstrapJs(); } $class = array(); $class[] = 'alert'; if ($this->isBlock) { $class[] = 'alert-block'; } if (in_array($this->type, array('warning', 'error', 'success', 'danger', 'info'))) { $class[] = 'alert-' . $this->type; } else { $class[] = 'info'; } if ($this->canClose && $this->fadeWhenClose) { $class[] = 'fade in'; } $htmlOptions = $this->htmlOptions; if (!isset($htmlOptions['class'])) { $htmlOptions['class'] = implode(' ', $class); } else { $htmlOptions['class'] = implode(' ', array_merge(explode(' ', $htmlOptions['class']), $class)); } $htmlOptions['data-alert'] = 'alert'; $html = ''; Yii::trace(CVarDumper::dumpAsString($this->canClose)); if ($this->canClose) { $html .= CHtml::link('×', '#', array('class' => 'close', 'data-dismiss' => 'alert')); } echo CHtml::openTag('div', $htmlOptions) . $html; }
public function run() { $nav = $content = ''; $first = true; $type = rtrim($this->type, 's'); foreach ($this->items as $id => $item) { if (is_array($item['content'])) { $id = "{$this->id}-{$id}"; $opts = $first ? array('class' => 'active') : array(); $opts['class'] = isset($opts['class']) ? $opts['class'] . ' dropdown' : 'dropdown'; $dropdown = array(); foreach ($item['content'] as $subId => $subTab) { Yii::trace(CVarDumper::dumpAsString($subTab)); $subOpts = array(); $subOpts['id'] = "{$id}-{$subId}"; $subOpts['class'] = 'tab-pane'; $content .= CHtml::tag('div', $subOpts, $subTab['content']); $dropdown[$subTab['title']] = '#' . $subOpts['id']; } Yii::trace(CVarDumper::dumpAsString($dropdown)); $nav .= CHtml::tag('li', $opts, BHtml::dropdownToggle($item['title']) . BHtml::dropdownMenu($dropdown, array('linkOptions' => array('data-toggle' => 'tab')))); } else { $id = "{$this->id}-{$id}"; $opts = $first ? array('class' => 'active') : array(); $nav .= CHtml::tag('li', $opts, CHtml::link($item['title'], "#{$id}", array('data-toggle' => $type))); $opts['id'] = $id; $opts['class'] = isset($opts['class']) ? $opts['class'] . ' tab-pane' : 'tab-pane'; $content .= CHtml::tag('div', $opts, $item['content']); } $first = false; } echo CHtml::tag('div', $this->htmlOptions, CHtml::tag('ul', $this->navOptions, $nav) . CHtml::tag('div', array('class' => 'tab-content'), $content)); BHtml::registerBootstrapJs(); }
<span class="help-block"> Hint: You may login with <tt>demo/demo</tt> or <tt>admin/admin</tt>. </span> </div> </div> <div class="<?php echo $form->fieldClass($model, 'rememberMe'); ?> "> <div class="controls"> <?php echo $form->checkBox($model, 'rememberMe'); ?> <?php echo $form->error($model, 'rememberMe'); ?> </div> </div> <div class="form-actions"> <?php echo BHtml::submitButton('Login'); ?> </div> <?php $this->endWidget(); ?> </div><!-- form -->
/** * Renders a button that makes the modal window appear. Great for those situations * when {@link $show} is set to false */ public function toggleButton($text, $htmlOptions = array()) { $htmlOptions['data-backdrop'] = $this->backdrop; $htmlOptions['data-keyboard'] = (bool) $this->keyboard; $htmlOptions['data-show'] = (bool) $this->show; echo BHtml::modalButton($text, $this->id, $htmlOptions); }
public function checkBox(CModel $model, $attribute, $htmlOptions = array()) { return BHtml::activeCheckBox($model, $attribute, $htmlOptions); }
<br/> <?php echo $form->textField($model, 'verifyCode'); ?> <?php echo $form->error($model, 'verifyCode'); ?> <p class="help-block"> Please enter the letters as they are shown in the image above. <br/>Letters are not case-sensitive. </p> </div> </div> <?php } ?> <div class="form-actions"> <?php echo BHtml::submitButton('Submit'); ?> </div> <?php $this->endWidget(); ?> </div><!-- form --> <?php }