Beispiel #1
0
 /**
  * Construct an instance of a Container.
  *
  * @param array $attributes
  * @param string|RenderableInterface|string[]|RenderableInterface[] $content
  */
 public function __construct(array $attributes, $content)
 {
     $classes = [];
     $this->extraSmall = (int) Arr::dotGet($attributes, 'extraSmall', 0);
     $this->small = (int) Arr::dotGet($attributes, 'small', 0);
     $this->medium = (int) Arr::dotGet($attributes, 'medium', 0);
     $this->large = (int) Arr::dotGet($attributes, 'large', 0);
     if ($this->extraSmall > 0) {
         $classes[] = 'col-xs-' . $this->extraSmall;
     }
     if ($this->small > 0) {
         $classes[] = 'col-sm-' . $this->small;
     }
     if ($this->medium > 0) {
         $classes[] = 'col-md-' . $this->medium;
     }
     if ($this->large > 0) {
         $classes[] = 'col-lg-' . $this->large;
     }
     if (Arr::has($attributes, 'class')) {
         $classes[] = $attributes['class'];
     }
     $attributes['class'] = implode(' ', $classes);
     parent::__construct('div', $attributes, $content, false);
 }
Beispiel #2
0
 /**
  * Construct an instance of a Row.
  *
  * @param array $attributes
  * @param \string[] $content
  * @param bool|false $fluid
  */
 public function __construct(array $attributes, $content, $fluid = false)
 {
     if (Arr::has($attributes, 'class')) {
         $attributes['class'] = implode(' ', ['row', $attributes['class']]);
     } else {
         $attributes['class'] = 'row';
     }
     parent::__construct('div', $attributes, $content, false);
 }
Beispiel #3
0
 /**
  * Construct an instance of a Container.
  *
  * @param array $attributes
  * @param \string[] $content
  * @param bool|false $fluid
  */
 public function __construct(array $attributes, $content, $fluid = false)
 {
     $this->fluid = $fluid;
     if (Arr::has($attributes, 'class')) {
         $attributes['class'] = implode(' ', [$this->fluid ? 'container-fluid' : 'container', $attributes['class']]);
     } else {
         $attributes['class'] = $this->fluid ? 'container-fluid' : 'container';
     }
     parent::__construct('div', $attributes, $content, false);
 }
Beispiel #4
0
 /**
  * Construct an instance of a Button.
  *
  * @param string[] $attributes
  * @param string|RenderableInterface|string[]|RenderableInterface[] $content
  */
 public function __construct($attributes, $content = '')
 {
     parent::__construct('body', $attributes, $content);
 }
Beispiel #5
0
 /**
  * Construct an instance of a Code.
  *
  * @param array $attributes
  * @param RenderableInterface|RenderableInterface[]|string|string[] $content
  */
 public function __construct(array $attributes, $content)
 {
     parent::__construct('code', $attributes, $content, false);
 }
Beispiel #6
0
 /**
  * Construct an instance of a Button.
  *
  * @param string[] $attributes
  * @param string|RenderableInterface|string[]|RenderableInterface[] $content
  */
 public function __construct($attributes, $content = '')
 {
     parent::__construct('hr', $attributes, $content, true);
 }
Beispiel #7
0
 /**
  * Construct an instance of a Button.
  *
  * @param string[] $attributes
  * @param ListItem[] $content
  */
 public function __construct($attributes, $content = [])
 {
     parent::__construct('ul', $attributes, $content);
 }
Beispiel #8
0
 /**
  * Construct an instance of a Button.
  *
  * @param string[] $attributes
  * @param string|RenderableInterface|string[]|RenderableInterface[] $content
  */
 public function __construct($attributes, $content = '')
 {
     parent::__construct('button', $attributes, $content);
     $this->spec = new Spec(['autofocus' => new PrimitiveTypeConstraint(CompoundTypes::COMPOUND_ARRAY), 'autocomplete' => new PrimitiveTypeConstraint(CompoundTypes::COMPOUND_ARRAY), 'disabled' => new PrimitiveTypeConstraint(ScalarTypes::SCALAR_BOOLEAN), 'form' => new PrimitiveTypeConstraint(ScalarTypes::SCALAR_STRING), 'name' => new PrimitiveTypeConstraint(ScalarTypes::SCALAR_STRING), 'type' => new InArrayConstraint([static::TYPE_SUBMIT, static::TYPE_BUTTON, static::TYPE_RESET]), 'value' => new PrimitiveTypeConstraint(ScalarTypes::SCALAR_STRING)]);
 }