Example #1
0
 /**
  * Renders the button group
  *
  * @return string
  */
 public function render()
 {
     $attributes = new Attributes($this->attributes, ['class' => $this->vertical ? 'btn-group-vertical' : 'btn-group']);
     if (!$this->links) {
         $attributes['data-toggle'] = 'buttons';
     }
     if ($this->size) {
         $attributes->addClass($this->size);
     }
     $contents = $this->renderContents();
     return "<div {$attributes}>{$contents}</div>";
 }
Example #2
0
 /**
  * Renders the navigation object
  *
  * @return string
  */
 public function render()
 {
     $attributes = new Attributes($this->attributes, ['class' => "nav {$this->type}"]);
     if ($this->justified) {
         $attributes->addClass('nav-justified');
     }
     if ($this->stacked) {
         $attributes->addClass('nav-stacked');
     }
     if ($this->float) {
         $attributes->addClass($this->float);
     }
     $string = "<ul {$attributes}>";
     foreach ($this->links as $link) {
         $string .= $this->renderItem($link);
     }
     $string .= "</ul>";
     return $string;
 }