public function __construct(array $options = null)
 {
     parent::__construct('a', $options);
     $this->addClass('navbar-brand');
     if ($options != null && is_array($options)) {
         if (array_key_exists('link', $options)) {
             $this->addAttribute('href', $options['link']);
         } else {
             $this->addAttribute('href', "#");
         }
         if (array_key_exists('img', $options)) {
             if (!array_key_exists('width', $options['img'])) {
                 $options['img']['width'] = 30;
             }
             if (!array_key_exists('height', $options['img'])) {
                 $options['img']['height'] = 30;
             }
             $this->addChildNode(new Img(['attributes' => ['width' => $options['img']['width'], 'height' => $options['img']['height'], 'alt' => 'Brand', 'src' => $options['img']['link']]]));
         } else {
             if (array_key_exists('title', $options['brand'])) {
                 $this->addChildNode(new Text($options['title']));
             } else {
                 $this->addChildNode(new Text('Brand'));
             }
         }
     }
 }
Ejemplo n.º 2
0
 public function __construct(array $options = null)
 {
     parent::__construct('div', $options);
     $this->setId('navbar');
     $this->addClass('navbar-collapse collapse');
     $this->opt = $options;
 }
Ejemplo n.º 3
0
 public function __construct(array $options = null)
 {
     if ($options != null) {
         if (is_array($options)) {
             if (array_key_exists('text', $options)) {
                 $this->text = $options['text'];
             }
         }
     }
     parent::__construct('h1', $options);
 }
 public function __construct(array $options = null)
 {
     parent::__construct('div', $options);
     $this->addClass('navbar-header');
     $this->addChildNode((new Button(['attributes' => ['type' => "button", 'class' => "navbar-toggle", 'data-toggle' => "collapse", 'data-target' => ".navbar-collapse"]]))->addChildNode((new Span())->addClass("icon-bar"))->addChildNode((new Span())->addClass("icon-bar"))->addChildNode((new Span())->addClass("icon-bar")));
     if ($options == null) {
         $options = [];
     }
     if (!array_key_exists('brand', $options)) {
         $options['brand'] = null;
     }
     $this->navBrand = new NavigationBrand($options['brand']);
 }
Ejemplo n.º 5
0
 /**
  * @param array|null $options
  */
 public function __construct(array $options = null)
 {
     if ($options == null) {
         $options = [];
     }
     if (!array_key_exists('head', $options)) {
         $options['head'] = null;
     }
     if (!array_key_exists('body', $options)) {
         $options['body'] = null;
     }
     if (!array_key_exists('footer', $options)) {
         $options['footer'] = null;
     }
     $this->head = new Head($options['head']);
     $this->body = new Body($options['body']);
     $this->footer = new Footer($options['footer']);
     parent::__construct('html', $options);
 }
Ejemplo n.º 6
0
 public function construct()
 {
     if ($this->opt['type'] === 'fluid') {
         parent::__construct('div', $this->opt);
         $this->addClass('container');
         $this->addChildNode((new Nav())->addClass('navbar navbar-default')->addChildNode((new Div())->addClass('container-fluid')->addChildNode($this->navigationHeader)->addChildNode($this->navigationBar)));
     } else {
         if ($this->opt['type'] === 'static') {
             parent::__construct('nav', $this->opt);
             $this->addClass('navbar navbar-default navbar-static-top');
             $this->addChildNode((new Div())->addClass('container')->addChildNode($this->navigationHeader)->addChildNode($this->navigationBar));
         } else {
             if ($this->opt['type'] === 'fixed') {
                 parent::__construct('nav', $this->opt);
                 $this->addClass('navbar navbar-default navbar-fixed-top');
                 $this->addChildNode((new Div())->addClass('container')->addChildNode($this->navigationHeader)->addChildNode($this->navigationBar));
             }
         }
     }
     return parent::construct();
 }
Ejemplo n.º 7
0
 public function __construct(array $options = null)
 {
     parent::__construct('link', $options);
 }
Ejemplo n.º 8
0
 public function __construct(array $options = null)
 {
     $this->styleSheets = [];
     parent::__construct('head', $options);
 }
Ejemplo n.º 9
0
 public function __construct($text)
 {
     $options = [];
     $options[0] = $text;
     parent::__construct(null, $options);
 }
Ejemplo n.º 10
0
 public function __construct(array $options = null)
 {
     $this->scripts = [];
     parent::__construct('body', $options);
     $this->container = (new Div())->addClass('container');
 }