Beispiel #1
0
 /**
  * Executes the widget.
  * @return string the result of widget execution to be outputted.
  * @uses [[Icon]]
  */
 public function run()
 {
     $tag = ArrayHelper::remove($this->options, 'tag', 'div');
     $html = Html::beginTag($tag, $this->options);
     if ($this->imageOptions) {
         $src = ArrayHelper::remove($this->imageOptions, 'src', '');
         $html .= Html::img($src, $this->imageOptions);
     }
     $html .= $this->encodeContent ? Html::encode($this->content) : $this->content;
     if ($this->renderIcon) {
         $html .= Icon::widget(['name' => ArrayHelper::getValue($this->icon, 'name', null), 'position' => ArrayHelper::getValue($this->icon, 'position', ''), 'options' => ArrayHelper::getValue($this->icon, 'options', [])]);
     }
     $html .= Html::endTag($tag);
     return $html;
 }
Beispiel #2
0
 /**
  * Renders the Modal footer.
  * @return string the rendered markup of the footer.
  * @uses [[renderCloseButton()]]
  */
 protected function renderFooter()
 {
     if (!$this->footer && $this->closeButtonPosition != self::CLOSE_BUTTON_POSITION_BEFORE_FOOTER && $this->closeButtonPosition != self::CLOSE_BUTTON_POSITION_AFTER_FOOTER) {
         return '';
     }
     $html = [];
     Html::addCssClass($this->footerOptions, ['footer' => 'modal-footer']);
     $html[] = Html::beginTag('div', $this->footerOptions);
     if ($this->closeButtonPosition === self::CLOSE_BUTTON_POSITION_BEFORE_FOOTER) {
         $html[] = $this->renderCloseButton();
     }
     $html[] = $this->footer;
     if ($this->closeButtonPosition === self::CLOSE_BUTTON_POSITION_AFTER_FOOTER) {
         $html[] = $this->renderCloseButton();
     }
     $html[] = Html::endTag('div');
     return implode("\n", $html);
 }
 /**
  * Renders the HTML markup for the on/off label.
  *
  * This method also renders the corresponding icons, if set.
  *
  * @param string $state the state to used. Use "off" or "on".
  * @return string the rendered label.
  * @uses [[Icon|Icon]]
  */
 protected function renderLabel($state)
 {
     $icon = $this->renderIcon($state);
     $encodeProperty = "encode" . ucfirst($state) . "Text";
     $textProperty = "{$state}Text";
     $label = $this->{$encodeProperty} ? Html::encode($this->{$textProperty}) : $this->{$textProperty};
     $label .= $icon;
     $html = [];
     $html[] = Html::beginTag('span', ['class' => "{$state}Label"]);
     $html[] = $label;
     $html[] = Html::endTag('span');
     return implode("\n", $html);
 }
 /**
  * Renders the widget.
  * @return string the result of widget execution to be outputted.
  */
 public function run()
 {
     if (empty($this->links)) {
         return;
     }
     echo Html::beginTag('nav', $this->containerOptions);
     echo Html::beginTag($this->tag, $this->options);
     if ($this->innerContainerOptions !== false) {
         $innerContainerTag = ArrayHelper::remove($this->innerContainerOptions, 'tag', 'div');
         echo Html::beginTag($innerContainerTag, $this->innerContainerOptions);
     }
     echo implode('', $this->prepareLinks());
     if ($this->innerContainerOptions !== false) {
         echo Html::endTag($innerContainerTag);
     }
     echo Html::endTag($this->tag);
     echo Html::endTag('nav');
 }
 /**
  * Executes the widget.
  * @return string the result of widget execution to be outputted.
  * @see Button|Button
  * @uses Button|Button
  * @uses [[renderItems()]]
  */
 public function run()
 {
     $html = Html::beginTag('div', $this->options);
     // Visible button
     $html .= Button::widget(['tagName' => $this->buttonTagName, 'label' => $this->buttonLabel, 'encodeLabel' => $this->buttonEncodeLabel, 'options' => $this->buttonOptions, 'icon' => $this->buttonIcon]);
     $html .= $this->renderItems();
     $html .= Html::endTag('div');
     return $html;
 }
Beispiel #6
0
 /**
  * Renders a single flash message.
  * @param string $message the content of the message
  * @param array $options the HTML attributes for the container tag
  * @return string
  */
 private function renderHtml($message, $options = [])
 {
     $html = Html::beginTag('div', $options);
     $html .= '<div class="card-panel">';
     $html .= $message;
     $html .= '</div>';
     $html .= Html::endTag('div');
     return $html;
 }
 /**
  * Executes the widget.
  * @return string the result of widget execution to be outputted.
  */
 public function run()
 {
     $html[] = Html::beginTag('div', $this->options);
     $html[] = Html::tag('div', null, $this->progressOptions);
     $html[] = Html::endTag('div');
     return implode("\n", $html);
 }
 /**
  * Executes the widget.
  * @return string the result of widget execution to be outputted.
  * @uses [[renderSpinner()]]
  */
 public function run()
 {
     $html[] = Html::beginTag('div', $this->options);
     if ($this->flashColors !== false) {
         foreach ($this->colors as $color) {
             Html::addCssClass($this->spinnerOptions, ['color' => 'spinner-' . $color]);
             $html[] = Html::beginTag('div', $this->spinnerOptions);
             $html[] = $this->renderSpinner();
             $html[] = Html::endTag('div');
             Html::removeCssClass($this->spinnerOptions, ['color' => 'spinner-' . $color]);
         }
     } else {
         $html[] = Html::beginTag('div', $this->spinnerOptions);
         $html[] = $this->renderSpinner();
         $html[] = Html::endTag('div');
     }
     $html[] = Html::endTag('div');
     return implode("\n", $html);
 }
Beispiel #9
0
 /**
  * Renders the widget.
  */
 public function run()
 {
     $html = [];
     $html[] = Html::endTag('div');
     // container
     $html[] = Html::endTag('div');
     // nav-wrapper
     $html[] = Html::endTag('nav');
     if ($this->fixed) {
         $html[] = Html::endTag('div');
     }
     MaterializePluginAsset::register($this->getView());
     return implode("\n", $html);
 }