Skip to content
PHP Ecosystem
Explore

Icon

API reference › Debug Core › Helper › Icon

final classPHPForge\Debug\Helper\Icon
Sourcesrc/Helper/Icon.php

Renders SVG icons bundled with the debug extension via Svg::tag().

MethodDescriptionDefined by
render() staticReturns the rendered SVG markup for the given icon name, or an empty string when the file does not exist.Icon
ConstantValueDescriptionDefined by
KEY_PATTERN'/\A[a-z0-9][a-z0-9-]*\z/'Shape an icon key must match: lowercase alphanumerics and hyphens, starting with an alphanumeric.Icon
public static function render(string $name): string

Returns the rendered SVG markup for the given icon name, or an empty string when the file does not exist.

Parameters

ParameterTypeDescription
$namestringIcon basename without the .svg extension (for example, chevron-down).

Returns

string: Sanitized SVG markup, or '' when the source file is missing.