Skip to content

Tag ​

php
final readonly class KMark\Tag

The HTML element that writes a text style: its name and its CSS classes.

new Tag('span', ['bold']);   // `<span class="bold">…</span>`

Source: src/Tag.php

Methods ​

__construct() ​

php
public function __construct(string $name, array $classes = [])

Throws InvalidArgumentException when the name or a class is not valid

wrap() ​

php
public function wrap(): string

The replacement of a regular expression: the element around the first group.

Documentation of 2.0.0 , built from f573e5f on 2.0.0 by pipeline #37507527063 on 2026-10-06.