Final Class Yiisoft\Html\Tag\Track
| Inheritance | Yiisoft\Html\Tag\Track » Yiisoft\Html\Tag\Base\VoidTag » Yiisoft\Html\Tag\Base\Tag |
|---|---|
| Implements | Yiisoft\Html\NoEncodeStringableInterface |
Protected Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $attributes | array | Yiisoft\Html\Tag\Base\Tag |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __toString() | Yiisoft\Html\Tag\Base\Tag | |
| addAttributes() | Add a set of attributes to existing tag attributes. | Yiisoft\Html\Tag\Base\Tag |
| addClass() | Add one or more CSS classes to the tag. | Yiisoft\Html\Tag\Base\Tag |
| addStyle() | Add CSS styles to the tag. | Yiisoft\Html\Tag\Base\Tag |
| attribute() | Set attribute value. | Yiisoft\Html\Tag\Base\Tag |
| attributes() | Replace attributes with a new set. | Yiisoft\Html\Tag\Base\Tag |
| class() | Replace current tag CSS classes with a new set of classes. | Yiisoft\Html\Tag\Base\Tag |
| default() | Yiisoft\Html\Tag\Track | |
| id() | Set tag ID. | Yiisoft\Html\Tag\Base\Tag |
| isDefault() | Yiisoft\Html\Tag\Track | |
| kind() | Yiisoft\Html\Tag\Track | |
| label() | Yiisoft\Html\Tag\Track | |
| removeStyle() | Remove CSS styles from the tag. | Yiisoft\Html\Tag\Base\Tag |
| render() | Yiisoft\Html\Tag\Base\Tag | |
| src() | Yiisoft\Html\Tag\Track | |
| srclang() | Yiisoft\Html\Tag\Track | |
| tag() | Yiisoft\Html\Tag\Base\VoidTag | |
| unionAttributes() | Union attributes with a new set. | Yiisoft\Html\Tag\Base\Tag |
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| after() | Yiisoft\Html\Tag\Base\Tag | |
| before() | Yiisoft\Html\Tag\Base\Tag | |
| getName() | Yiisoft\Html\Tag\Track | |
| prepareAttributes() | Yiisoft\Html\Tag\Base\Tag | |
| renderAttributes() | Render the current tag attributes. | Yiisoft\Html\Tag\Base\Tag |
| renderTag() | Yiisoft\Html\Tag\Base\VoidTag |
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| CAPTIONS | 'captions' | Yiisoft\Html\Tag\Track | |
| CHAPTERS | 'chapters' | Yiisoft\Html\Tag\Track | |
| DESCRIPTIONS | 'descriptions' | Yiisoft\Html\Tag\Track | |
| METADATA | 'metadata' | Yiisoft\Html\Tag\Track | |
| SUBTITLES | 'subtitles' | Yiisoft\Html\Tag\Track |
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\Track 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\Track 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;
}
Defined in: Yiisoft\Html\Tag\Base\Tag::addStyle()
Add CSS styles to the tag.
See also Yiisoft\Html\Html::addCssStyle().
| public Yiisoft\Html\Tag\Track 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;
}
Defined in: Yiisoft\Html\Tag\Base\Tag::after()
| protected string after ( ) |
protected function after(): string
{
return '';
}
Defined in: Yiisoft\Html\Tag\Base\Tag::attribute()
Set attribute value.
| public Yiisoft\Html\Tag\Track 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\Track 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\Track 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;
}
| public self default ( boolean $default = true ) | ||
| $default | boolean | |
public function default(bool $default = true): self
{
return $this->attribute('default', $default);
}
Defined in: Yiisoft\Html\Tag\Base\Tag::id()
Set tag ID.
| public Yiisoft\Html\Tag\Track 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;
}
| public boolean isDefault ( ) |
public function isDefault(): bool
{
return (bool) ($this->attributes['default'] ?? false);
}
See also:
- \Yiisoft\Html\Tag\self::SUBTITLES
- \Yiisoft\Html\Tag\self::CAPTIONS
- \Yiisoft\Html\Tag\self::DESCRIPTIONS
- \Yiisoft\Html\Tag\self::CHAPTERS
- \Yiisoft\Html\Tag\self::METADATA
| public self kind ( string|null $kind ) | ||
| $kind | string|null | |
public function kind(?string $kind): self
{
return $this->attribute('kind', $kind);
}
| public self label ( string|null $label ) | ||
| $label | string|null | |
public function label(?string $label): self
{
return $this->attribute('label', $label);
}
Defined in: Yiisoft\Html\Tag\Base\Tag::prepareAttributes()
| protected void prepareAttributes ( ) |
protected function prepareAttributes(): void {}
Defined in: Yiisoft\Html\Tag\Base\Tag::removeStyle()
Remove CSS styles from the tag.
See also Yiisoft\Html\Html::removeCssStyle().
| public Yiisoft\Html\Tag\Track 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() . '>';
}
| public self src ( string $src ) | ||
| $src | string | |
public function src(string $src): self
{
return $this->attribute('src', $src);
}
| public self srclang ( string|null $srclang ) | ||
| $srclang | string|null | |
public function srclang(?string $srclang): self
{
return $this->attribute('srclang', $srclang);
}
Defined in: Yiisoft\Html\Tag\Base\VoidTag::tag()
| public static Yiisoft\Html\Tag\Track 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\Track 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;
}
Signup or Login in order to comment.