Exemplo n.º 1
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct('<nav>');
     $this->addClass(['navbar', 'navbar-default']);
     $this->elements = new Container();
     self::translator()->addFile(__DIR__ . '/../../lang/global', 'bootstrap');
 }
Exemplo n.º 2
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct('<div>');
     $this->addClass('cawa-tabs');
     $this->header = (new HtmlContainer('<ul>'))->addClass('nav nav-tabs')->addAttribute('data-tabs', 'tabs');
     $this->body = (new HtmlContainer('<div>'))->addClass('tab-content');
 }
Exemplo n.º 3
0
 /**
  * @param string $tag
  * @param string $label
  * @param string $name
  */
 public function __construct(string $tag, string $name = null, string $label = null)
 {
     parent::__construct('<div>');
     $this->field = new HtmlContainer($tag);
     if ($name) {
         $this->setName($name);
     }
     if ($label) {
         $this->setLabel($label);
     }
 }
Exemplo n.º 4
0
 /**
  * @param string $content
  * @param string $type
  * @param string $size
  */
 public function __construct(string $content, string $type = self::TYPE_DEFAULT, string $size = null)
 {
     if (!$this->tag) {
         $this->tag = '<button>';
     }
     parent::__construct(null, $content);
     $this->addClass(['btn', $type]);
     if ($size) {
         $this->addClass($size);
     }
 }
Exemplo n.º 5
0
 /**
  * @param int $page
  * @param callable $argsCallback
  */
 public function __construct(int $page, callable $argsCallback = null)
 {
     parent::__construct('<nav>');
     $this->page = $page;
     if ($argsCallback) {
         $this->argsCallback = $argsCallback;
     } else {
         $this->argsCallback = function (self $caller, int $page = null) {
             if ($page) {
                 return Uri::parse()->addQuery(self::QUERY_PAGE, (string) $page)->get();
             } else {
                 return (int) Uri::parse()->getQuery(self::QUERY_PAGE);
             }
         };
     }
     $this->current = call_user_func($this->argsCallback, $this) ?: 1;
     $this->ul = new HtmlContainer('<ul>');
     $this->ul->addClass('pagination');
 }
Exemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function __construct()
 {
     parent::__construct('<img />');
     $this->queries['key'] = DI::config()->get('googleMaps/apikey');
 }
Exemplo n.º 7
0
 /**
  * @param string $content
  */
 public function __construct(string $content = null)
 {
     parent::__construct('<label>');
     $this->setContent($content);
 }
Exemplo n.º 8
0
 /**
  * @param string $content
  * @param string $type
  */
 public function __construct(string $content, string $type = self::TYPE_DEFAULT)
 {
     parent::__construct('<span>', $content);
     $this->addAttributes(['class' => 'label']);
     $this->addClass($type);
 }
Exemplo n.º 9
0
 /**
  * @param string $content
  * @param string $type
  */
 public function __construct(string $content, string $type = self::DANGER)
 {
     parent::__construct('<div>', $content);
     $this->addAttributes(['class' => 'alert', 'role' => 'alert']);
     $this->addClass($type);
 }