Final Class Yiisoft\Html\Tag\Input\Range
| Inheritance | Yiisoft\Html\Tag\Input\Range » Yiisoft\Html\Tag\Base\InputTag » Yiisoft\Html\Tag\Base\VoidTag » Yiisoft\Html\Tag\Base\Tag |
|---|---|
| Implements | Yiisoft\Html\NoEncodeStringableInterface |
An imprecise control for setting the element’s value to a string representing a number.
Protected Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $attributes | array | Yiisoft\Html\Tag\Base\Tag |
Public Methods
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| after() | Yiisoft\Html\Tag\Input\Range | |
| before() | Yiisoft\Html\Tag\Base\Tag | |
| getName() | Yiisoft\Html\Tag\Base\InputTag | |
| prepareAttributes() | Yiisoft\Html\Tag\Input\Range | |
| renderAttributes() | Render the current tag attributes. | Yiisoft\Html\Tag\Base\Tag |
| renderTag() | Yiisoft\Html\Tag\Base\VoidTag |
Method Details
Defined in: Yiisoft\Html\Tag\Base\Tag::__toString()
| public string __toString ( ) |
final public function __toString(): string
{
return $this->render();
}
Defined in: Yiisoft\Html\Tag\Base\Tag::addAttributes()
Add a set of attributes to existing tag attributes.
Same named attributes are replaced.
| public Yiisoft\Html\Tag\Input\Range addAttributes ( array $attributes ) | ||
| $attributes | array |
Name-value set of attributes. |
final public function addAttributes(array $attributes): static
{
$new = clone $this;
$new->attributes = array_merge($new->attributes, $attributes);
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\Tag::addClass()
Add one or more CSS classes to the tag.
| public Yiisoft\Html\Tag\Input\Range addClass ( \BackedEnum|string|null $class ) | ||
| $class | \BackedEnum|string|null |
One or many CSS classes. |
final public function addClass(BackedEnum|string|null ...$class): static
{
$new = clone $this;
Html::addCssClass($new->attributes, $class);
return $new;
}
| public self addOutputAttributes ( array $attributes ) | ||
| $attributes | array | |
public function addOutputAttributes(array $attributes): self
{
$new = clone $this;
$new->outputAttributes = array_merge($this->outputAttributes, $attributes);
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\Tag::addStyle()
Add CSS styles to the tag.
See also Yiisoft\Html\Html::addCssStyle().
| public Yiisoft\Html\Tag\Input\Range addStyle ( string|string[] $style, boolean $overwrite = true ) | ||
| $style | string|string[] |
The new style string (e.g. |
| $overwrite | boolean |
Whether to overwrite existing CSS properties if the new style contain them too. |
final public function addStyle(array|string $style, bool $overwrite = true): static
{
$new = clone $this;
Html::addCssStyle($new->attributes, $style, $overwrite);
return $new;
}
| protected string after ( ) |
protected function after(): string
{
if (!$this->showOutput) {
return '';
}
return "\n" . CustomTag::name($this->outputTag)
->attributes($this->outputAttributes)
->content((string) ($this->attributes['value'] ?? '-'))
->id($this->outputId)
->render();
}
Defined in: Yiisoft\Html\Tag\Base\Tag::attribute()
Set attribute value.
| public Yiisoft\Html\Tag\Input\Range attribute ( string $name, mixed $value ) | ||
| $name | string |
Name of the attribute. |
| $value | mixed |
Value of the attribute. |
final public function attribute(string $name, mixed $value): static
{
$new = clone $this;
$new->attributes[$name] = $value;
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\Tag::attributes()
Replace attributes with a new set.
| public Yiisoft\Html\Tag\Input\Range attributes ( array $attributes ) | ||
| $attributes | array |
Name-value set of attributes. |
final public function attributes(array $attributes): static
{
$new = clone $this;
$new->attributes = $attributes;
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\Tag::before()
| protected string before ( ) |
protected function before(): string
{
return '';
}
Defined in: Yiisoft\Html\Tag\Base\Tag::class()
Replace current tag CSS classes with a new set of classes.
| public Yiisoft\Html\Tag\Input\Range class ( \BackedEnum|string|null $class ) | ||
| $class | \BackedEnum|string|null |
One or many CSS classes. |
final public function class(BackedEnum|string|null ...$class): static
{
$new = clone $this;
unset($new->attributes['class']);
Html::addCssClass($new->attributes, $class);
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\InputTag::disabled()
| public Yiisoft\Html\Tag\Input\Range disabled ( boolean $disabled = true ) | ||
| $disabled | boolean |
Whether input is disabled. |
public function disabled(bool $disabled = true): static
{
$new = clone $this;
$new->attributes['disabled'] = $disabled;
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\InputTag::form()
| public Yiisoft\Html\Tag\Input\Range form ( string|null $formId ) | ||
| $formId | string|null |
ID of the form input belongs to. |
public function form(?string $formId): static
{
$new = clone $this;
$new->attributes['form'] = $formId;
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\InputTag::getName()
| protected string getName ( ) |
protected function getName(): string
{
return 'input';
}
Defined in: Yiisoft\Html\Tag\Base\Tag::id()
Set tag ID.
| public Yiisoft\Html\Tag\Input\Range id ( string|null $id ) | ||
| $id | string|null |
Tag ID. |
final public function id(?string $id): static
{
$new = clone $this;
$new->attributes['id'] = $id;
return $new;
}
ID of element that lists predefined options suggested to the user.
| public self list ( string|null $id ) | ||
| $id | string|null | |
public function list(?string $id): self
{
$new = clone $this;
$new->attributes['list'] = $id;
return $new;
}
Maximum value.
| public self max ( float|integer|string|\Stringable|null $value ) | ||
| $value | float|integer|string|\Stringable|null | |
public function max(float|int|string|Stringable|null $value): self
{
$new = clone $this;
$new->attributes['max'] = $value;
return $new;
}
Minimum value.
| public self min ( float|integer|string|\Stringable|null $value ) | ||
| $value | float|integer|string|\Stringable|null | |
public function min(float|int|string|Stringable|null $value): self
{
$new = clone $this;
$new->attributes['min'] = $value;
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\InputTag::name()
| public Yiisoft\Html\Tag\Input\Range name ( string|null $name ) | ||
| $name | string|null |
Name of the input. |
public function name(?string $name): static
{
$new = clone $this;
$new->attributes['name'] = $name;
return $new;
}
| public self outputAttributes ( array $attributes ) | ||
| $attributes | array | |
public function outputAttributes(array $attributes): self
{
$new = clone $this;
$new->outputAttributes = $attributes;
return $new;
}
| public self outputTag ( string $tagName ) | ||
| $tagName | string | |
public function outputTag(string $tagName): self
{
if ($tagName === '') {
throw new InvalidArgumentException('The output tag name it cannot be empty value.');
}
$new = clone $this;
$new->outputTag = $tagName;
return $new;
}
| protected void prepareAttributes ( ) |
protected function prepareAttributes(): void
{
$this->attributes['type'] = 'range';
if ($this->showOutput) {
$this->fillOutputId();
$this->attributes['oninput'] = 'document.getElementById("' . $this->outputId . '").innerHTML=this.value';
}
}
Defined in: Yiisoft\Html\Tag\Base\InputTag::readonly()
| public Yiisoft\Html\Tag\Input\Range readonly ( boolean $readOnly = true ) | ||
| $readOnly | boolean |
Whether input is read only. |
public function readonly(bool $readOnly = true): static
{
$new = clone $this;
$new->attributes['readonly'] = $readOnly;
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\Tag::removeStyle()
Remove CSS styles from the tag.
See also Yiisoft\Html\Html::removeCssStyle().
| public Yiisoft\Html\Tag\Input\Range removeStyle ( string|string[] $properties ) | ||
| $properties | string|string[] |
The CSS properties to be removed. You may use a string if you are removing a single property. |
final public function removeStyle(string|array $properties): static
{
$new = clone $this;
Html::removeCssStyle($new->attributes, $properties);
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\Tag::render()
| public string render ( ) |
final public function render(): string
{
return $this->before() . $this->renderTag() . $this->after();
}
Defined in: Yiisoft\Html\Tag\Base\Tag::renderAttributes()
Render the current tag attributes.
See also Yiisoft\Html\Html::renderTagAttributes().
| protected string renderAttributes ( ) |
final protected function renderAttributes(): string
{
$this->prepareAttributes();
return Html::renderTagAttributes($this->attributes);
}
Defined in: Yiisoft\Html\Tag\Base\VoidTag::renderTag()
| protected string renderTag ( ) |
final protected function renderTag(): string
{
return '<' . $this->getName() . $this->renderAttributes() . '>';
}
Defined in: Yiisoft\Html\Tag\Base\InputTag::required()
| public Yiisoft\Html\Tag\Input\Range required ( boolean $required = true ) | ||
| $required | boolean |
Whether input is required. |
public function required(bool $required = true): static
{
$new = clone $this;
$new->attributes['required'] = $required;
return $new;
}
| public self showOutput ( boolean $show = true ) | ||
| $show | boolean | |
public function showOutput(bool $show = true): self
{
$new = clone $this;
$new->showOutput = $show;
return $new;
}
Granularity to be matched by the form control's value.
| public self step ( float|integer|string|\Stringable|null $value ) | ||
| $value | float|integer|string|\Stringable|null | |
public function step(float|int|string|Stringable|null $value): self
{
$new = clone $this;
$new->attributes['step'] = $value;
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\VoidTag::tag()
| public static Yiisoft\Html\Tag\Input\Range tag ( ) |
final public static function tag(): static
{
return new static();
}
Defined in: Yiisoft\Html\Tag\Base\Tag::unionAttributes()
Union attributes with a new set.
| public Yiisoft\Html\Tag\Input\Range unionAttributes ( array $attributes ) | ||
| $attributes | array |
Name-value set of attributes. |
final public function unionAttributes(array $attributes): static
{
$new = clone $this;
$new->attributes += $attributes;
return $new;
}
Defined in: Yiisoft\Html\Tag\Base\InputTag::value()
| public Yiisoft\Html\Tag\Input\Range value ( boolean|float|integer|string|\Stringable|null $value ) | ||
| $value | boolean|float|integer|string|\Stringable|null |
Value of the input. |
public function value(bool|float|int|string|Stringable|null $value): static
{
$new = clone $this;
$new->attributes['value'] = $value;
return $new;
}
Signup or Login in order to comment.