Пример #1
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     Yii::app()->clientScript->registerCoreScript('jquery');
     $this->attachBehavior('BsWidget', new BsWidget());
     $this->copyId();
     BSHtml::addCssClass('collapse', $this->htmlOptions);
     if (isset($this->parent)) {
         \bootstrap\helpers\BSArray::defaultValue('data-parent', $this->parent, $this->htmlOptions);
     }
     if (isset($this->toggle) && $this->toggle) {
         BSHtml::addCssClass('in', $this->htmlOptions);
     }
     if (isset($this->view)) {
         $controller = $this->getController();
         if (isset($controller) && $controller->getViewFile($this->view) !== false) {
             $this->content = $this->controller->renderPartial($this->view, $this->viewData, true);
         }
     }
     echo BSHtml::openTag($this->tagName, $this->htmlOptions);
     echo $this->content;
 }
Пример #2
0
 /**
  * Renders the modal markup
  */
 public function renderModal()
 {
     echo BSHtml::openTag('div', $this->htmlOptions) . PHP_EOL;
     $this->renderModalHeader();
     $this->renderModalBody();
     $this->renderModalFooter();
     echo '</div>' . PHP_EOL;
 }