Beispiel #1
0
 /**
  *
  * {@inheritDoc}
  *
  * @see \Core\Html\HtmlBuildableInterface::build()
  */
 public function build()
 {
     if (!$this->html instanceof AbstractHtml) {
         throw new HtmlException('Bootstrap Alert object need a html object that is an instance of HtmlAbstact');
     }
     $this->html->addCss(['alert', 'alert-' . $this->context]);
     if ($this->dismissable) {
         $this->html->addCss('alert-dismissable');
         $this->html->setInner('<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>');
     }
     $this->html->addInner($this->content);
     $this->html->setRole('alert');
     return $this->html->build();
 }