/** * @param string|null $content * @param string|null $link */ public function __construct(string $content = null, string $link = null) { parent::__construct('<a>', $content); if ($link) { $this->setHref($link); } }
/** * @param string $type * @param string $title * @param string $content */ public function __construct(string $type = self::TYPE_DEFAULT, string $title = null, string $content = null) { parent::__construct('<div>', $content); $this->addClass(['panel', $type]); $this->container = new Container(); $this->title = $title; }
/** * @param string $legend */ public function __construct(string $legend = null) { parent::__construct('<fieldset>'); if ($legend) { $this->add(new HtmlElement('<legend>', $legend)); } }
/** * @param array $keyValue */ public function __construct(array $keyValue = []) { parent::__construct('<dl>'); foreach ($keyValue as $key => $value) { $this->addDescription($key, $value); } }
/** * @param string $stateId */ public function __construct(string $stateId = null) { $this->stateId = $stateId; // default callback to get query param $this->argsCallback = function ($item, $arg = null) { $query = $this->stateId ? $this->stateId . '_' : ''; if ($item instanceof Pagination) { $query .= Pagination::QUERY_PAGE; } elseif ($item instanceof Column) { $query .= Table::QUERY_SORT; } elseif (is_string($item)) { $query .= $item; } if ($arg) { return self::request()->getUri()->addQuery($query, (string) $arg)->get(); } else { return self::request()->getUri()->getQuery($query); } }; parent::__construct('<div>'); $this->addClass('cawa-grid'); $this->addClass('grid-table'); self::translator()->addFile(__DIR__ . '/../../lang/global', 'bootstrap'); $this->navbar = (new Navbar())->setInverse(); $this->add($this->navbar); $this->options = new Dropdown('<i class="fa fa-adjust"></i> ' . self::trans('bootstrap.grid/options')); // refresh $this->options->add(new Link('<i class="glyphicon glyphicon-refresh"></i> ' . self::trans('bootstrap.grid/refresh'), self::request()->getUri()->get())); $ul = new HtmlContainer('<ul>'); $ul->add($this->options->toNavbar()); $this->navbar->add($ul); $this->table = new Table(); $this->table->setArgsCallback($this->argsCallback); $this->add($this->table); }
/** * @param string $content * @param string $tag * @param string $type */ public function __construct(string $content = null, $tag = '<li>', string $type = null) { parent::__construct($tag, $content); $this->addClass('list-group-item'); if ($type) { $this->addClass($type); } }
/** * @param string $id * @param string $name */ public function __construct(string $id, $name = null) { parent::__construct('<th>'); $this->id = $id; if ($name) { $this->setContent($name); } }
/** * {@inheritdoc} */ public function __construct() { parent::__construct('<div>'); $this->addClass('cawa-google-map'); $this->add(new HtmlElement('<div>')); $this->widgetOptions = new WidgetOption(['key' => DI::config()->get('googleMaps/apikey')]); $this->setZoom(15); }
/** * @param string $class */ public function __construct(string $class = null) { parent::__construct('<span>'); $this->addClass('input-group-addon'); $element = new HtmlElement('<i>'); $element->addClass($class); $this->add($element); }
/** * @param string|null $label */ public function __construct(string $label = null) { parent::__construct('<div>'); $this->container = new HtmlContainer('<div>'); $this->elements[] = $this->container; if ($label) { $this->setLabel($label); } }
/** * */ public function __construct() { parent::__construct('<html>'); $this->head = new HtmlContainer('<head>'); $this->add($this->head); $this->footer = new Container(); $this->body = new HtmlContainer('<body>'); $this->add($this->body); }
/** * @param string $size */ public function __construct(string $size = null) { parent::__construct('<div>'); $this->addClass('btn-group'); $this->addAttribute('role', 'group'); if ($size) { $this->addClass($size); } }
/** * */ public function __construct() { self::translator()->addFile(__DIR__ . '/../../lang/global', 'html'); parent::__construct('<table>'); $this->thead = new HtmlContainer('<thead>'); $this->tbody = new HtmlContainer('<tbody>'); $this->elements[] = $this->thead; $this->elements[] = $this->tbody; }
/** * @param array|string $class */ public function __construct($class = null) { parent::__construct('<div>'); if ($class) { $this->addClass($class); } }
/** * @param string $tag */ public function __construct($tag = '<ul>') { parent::__construct($tag); $this->addClass('list-group'); }
/** * */ public function __construct() { parent::__construct('<form>'); $this->addAttributes(['role' => 'form', 'method' => 'POST']); }
/** * */ public function __construct() { parent::__construct('<div>'); $this->addClass('cawa-collapse panel-group')->addAttributes(['role' => 'tablist', 'aria-multiselectable' => 'true']); }
/** * {@inheritdoc} */ public function __construct() { parent::__construct('<div>'); $this->addClass('cawa-carousel'); $this->widgetOptions = new WidgetOption(); }
/** * @param string $title */ public function __construct(string $title) { parent::__construct('<div>'); $this->addClass('tab-pane'); $this->title = $title; }
/** * */ public function __construct() { parent::__construct('<div>'); $this->addClass('row'); }