예제 #1
0
파일: Link.php 프로젝트: cawaphp/html
 /**
  * @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);
     }
 }
예제 #2
0
파일: Panel.php 프로젝트: cawaphp/bootstrap
 /**
  * @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;
 }
예제 #3
0
파일: Fieldset.php 프로젝트: cawaphp/html
 /**
  * @param string $legend
  */
 public function __construct(string $legend = null)
 {
     parent::__construct('<fieldset>');
     if ($legend) {
         $this->add(new HtmlElement('<legend>', $legend));
     }
 }
예제 #4
0
 /**
  * @param array $keyValue
  */
 public function __construct(array $keyValue = [])
 {
     parent::__construct('<dl>');
     foreach ($keyValue as $key => $value) {
         $this->addDescription($key, $value);
     }
 }
예제 #5
0
파일: Grid.php 프로젝트: cawaphp/bootstrap
 /**
  * @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);
 }
예제 #6
0
 /**
  * @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);
     }
 }
예제 #7
0
파일: Column.php 프로젝트: cawaphp/html
 /**
  * @param string $id
  * @param string $name
  */
 public function __construct(string $id, $name = null)
 {
     parent::__construct('<th>');
     $this->id = $id;
     if ($name) {
         $this->setContent($name);
     }
 }
예제 #8
0
파일: Map.php 프로젝트: cawaphp/widget
 /**
  * {@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);
 }
예제 #9
0
 /**
  * @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);
 }
예제 #10
0
파일: Group.php 프로젝트: cawaphp/html
 /**
  * @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);
     }
 }
예제 #11
0
파일: HtmlPage.php 프로젝트: cawaphp/cawa
 /**
  *
  */
 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);
 }
예제 #12
0
 /**
  * @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);
     }
 }
예제 #13
0
파일: Table.php 프로젝트: cawaphp/html
 /**
  *
  */
 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;
 }
예제 #14
0
파일: Col.php 프로젝트: cawaphp/bootstrap
 /**
  * @param array|string $class
  */
 public function __construct($class = null)
 {
     parent::__construct('<div>');
     if ($class) {
         $this->addClass($class);
     }
 }
예제 #15
0
 /**
  * @param string $tag
  */
 public function __construct($tag = '<ul>')
 {
     parent::__construct($tag);
     $this->addClass('list-group');
 }
예제 #16
0
파일: Form.php 프로젝트: cawaphp/html
 /**
  *
  */
 public function __construct()
 {
     parent::__construct('<form>');
     $this->addAttributes(['role' => 'form', 'method' => 'POST']);
 }
예제 #17
0
 /**
  *
  */
 public function __construct()
 {
     parent::__construct('<div>');
     $this->addClass('cawa-collapse panel-group')->addAttributes(['role' => 'tablist', 'aria-multiselectable' => 'true']);
 }
예제 #18
0
파일: Carousel.php 프로젝트: cawaphp/widget
 /**
  * {@inheritdoc}
  */
 public function __construct()
 {
     parent::__construct('<div>');
     $this->addClass('cawa-carousel');
     $this->widgetOptions = new WidgetOption();
 }
예제 #19
0
파일: Tab.php 프로젝트: cawaphp/bootstrap
 /**
  * @param string $title
  */
 public function __construct(string $title)
 {
     parent::__construct('<div>');
     $this->addClass('tab-pane');
     $this->title = $title;
 }
예제 #20
0
파일: Row.php 프로젝트: cawaphp/bootstrap
 /**
  *
  */
 public function __construct()
 {
     parent::__construct('<div>');
     $this->addClass('row');
 }