Exemple #1
0
 /**
  * Renders the HTML markup for the footer of the modal.
  * This will also render buttons.
  * @return string the rendering result
  */
 public function renderFooter()
 {
     $footer = parent::renderFooter();
     if (empty($footer) && (isset($this->cancelButton) || isset($this->submitButton))) {
         if ($this->cancelButton) {
             $footer .= Button::widget($this->cancelButton);
         }
         if ($this->submitButton) {
             $footer .= Button::widget($this->submitButton);
         }
         Html::addCssClass($this->footerOptions, 'modal-footer');
         $footer = Html::tag('div', "\n" . $footer . "\n", $this->footerOptions);
     }
     return $footer;
 }
 /**
  * Generates the buttons that compound the group as specified on [[buttons]].
  * @return string the rendering result.
  */
 protected function renderButtons()
 {
     $buttons = [];
     foreach ($this->buttons as $button) {
         if (is_array($button)) {
             $visible = ArrayHelper::remove($button, 'visible', true);
             if ($visible === false) {
                 continue;
             }
             $button['view'] = $this->getView();
             if (!isset($button['encodeLabel'])) {
                 $button['encodeLabel'] = $this->encodeLabels;
             }
             if (!empty($this->type) && !isset($button['type'])) {
                 $button['type'] = $this->type;
             }
             $buttons[] = Button::widget($button);
         } else {
             $buttons[] = $button;
         }
     }
     return implode("\n", $buttons);
 }