Skip to content

Html ​

php
final class KMark\Html

Small helpers to write HTML.

Source: src/Html.php

Methods ​

attribute() ​

php
public static function attribute(string $value): string

The value of an attribute.

escape() ​

php
public static function escape(string $text): string

The text with its special characters written as entities, except the entities that are already there.

escapeCode() ​

php
public static function escapeCode(string $text): string

The text of a code span or of a code block: every special character is written as an entity.

withAttributes() ​

php
public static function withAttributes(string $html, Attributes $attributes): string

Adds attributes to the first tag of an HTML block, with the ones it already has: the id of the first wins, the classes are added to each other.

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