Html\Attributes
ClassSource on GitHubThis class helps to work with HTML Attributes
@extends Collection<mixed>
Phalcon\Support\CollectionPhalcon\Html\Attributes- implementsPhalcon\Html\Attributes\RenderInterface
Uses Phalcon\Html\Attributes\RenderInterface · Phalcon\Html\Escaper\AttributeEscaper · Phalcon\Html\Exceptions\AttributeNotRenderable · Phalcon\Support\Collection
Method Summary
publicstring__toString()Alias of the render method
publicstringrender()Render attributes as HTML attributes
protectedstringrenderAttributes(array $attributes)@todo remove this when we refactor forms. Maybe remove this class? Put it into traits
Methods
__toString()
public function __toString(): string;Alias of the render method
render()
public function render(): string;Render attributes as HTML attributes
renderAttributes()
protected function renderAttributes( array $attributes ): string;@todo remove this when we refactor forms. Maybe remove this class? Put it into traits
Html\Attributes\AttributesInterface
InterfaceSource on GitHubHtml Attributes Interface
Phalcon\Html\Attributes\AttributesInterface
Uses Phalcon\Html\Attributes
Method Summary
publicAttributesgetAttributes()Get Attributes
publicAttributesInterfacesetAttributes(Attributes $attributes)Set Attributes
Methods
getAttributes()
public function getAttributes(): Attributes;Get Attributes
setAttributes()
public function setAttributes( Attributes $attributes ): AttributesInterface;Set Attributes
Html\Attributes\RenderInterface
InterfaceSource on GitHubRendering interface for HTML attributes
Phalcon\Html\Attributes\RenderInterface
Method Summary
Methods
render()
public function render(): string;Generate a string representation
Html\Breadcrumbs
ClassSource on GitHubPhalcon\Html\Breadcrumbs
This component offers an easy way to create breadcrumbs for your application.
The resulting HTML when calling render() will have each breadcrumb enclosed
in <dt> tags, while the whole string is enclosed in <dl> tags.
Phalcon\Html\Breadcrumbs
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
publicstaticadd(string $label,string $link = "")Adds a new crumb.
publicvoidclear()Clears the crumbs
publicstringgetSeparator()Returns the separator
publicvoidremove(string $link)Removes crumb by url.
publicstringrender()Renders and outputs breadcrumbs based on previously set template.
publicstaticsetSeparator(string $separator)Set the separator
publicarraytoArray()Returns the internal breadcrumbs array
Methods
add()
public function add(
string $label,
string $link = ""
): static;Adds a new crumb.
// Adding a crumb with a link
$breadcrumbs->add("Home", "/");
// Adding a crumb without a link (normally the last one)
$breadcrumbs->add("Users");Crumbs are stored keyed by their link, so adding two crumbs that share the same link - including two link-less crumbs, which share the empty string key - keeps only the last one.
clear()
public function clear(): void;Clears the crumbs
$breadcrumbs->clear()getSeparator()
public function getSeparator(): string;Returns the separator
remove()
public function remove( string $link ): void;Removes crumb by url.
$breadcrumbs->remove("/admin/user/create");
// remove a crumb without an url (last link)
$breadcrumbs->remove();render()
public function render(): string;Renders and outputs breadcrumbs based on previously set template.
echo $breadcrumbs->render();setSeparator()
public function setSeparator( string $separator ): static;Set the separator
toArray()
public function toArray(): array;Returns the internal breadcrumbs array
Html\Escaper
ClassSource on GitHubPhalcon\Html\Escaper
Escapes different kinds of text securing them. By using this component you may prevent XSS attacks.
The class is a façade over five per-context escapers (HtmlEscaper,
AttributeEscaper, CssEscaper, JsEscaper, UrlEscaper). Each can be
retrieved via the matching getXxxEscaper() accessor and substituted via
the matching setXxxEscaper() setter. The legacy setEncoding,
setFlags, and setDoubleEncode continue to fan out to all sub-objects
so existing code keeps working.
This component only works with UTF-8. The PREG extension needs to be compiled with UTF-8 support.
$escaper = new \Phalcon\Html\Escaper();
$escaped = $escaper->css("font-family: <Verdana>");
echo $escaped; // font\2D family\3A \20 \3C Verdana\3EPhalcon\Html\Escaper- implementsPhalcon\Html\Escaper\EscaperInterface
Uses Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Escaper\AttributeEscaper · Phalcon\Html\Escaper\CssEscaper · Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Escaper\HtmlEscaper · Phalcon\Html\Escaper\JsEscaper · Phalcon\Html\Escaper\UrlEscaper
Method Summary
public__construct(string $encoding = "utf-8",int $flags = 11,bool $doubleEncode = true)Constructor. Accepts the legacy scalar params for backward compatibility
publicstringattributes(mixed $input = null)Escapes a HTML attribute string or array. Delegates to AttributeEscaper.
publicstringcss(string $input)Escape CSS strings. Delegates to CssEscaper.
publicstring|nulldetectEncoding(string $input)Detects the character encoding of a string. Delegates to HtmlEscaper.
publicstringescapeCss(string $input)publicstringescapeHtml(string|null $input = null)publicstringescapeHtmlAttr(string|null $input = null)publicstringescapeJs(string $input)publicstringescapeUrl(string $input)publicAttributeEscapergetAttributeEscaper()publicCssEscapergetCssEscaper()publicstringgetEncoding()Returns the encoding from the HtmlEscaper.
publicintgetFlags()Returns the flags from the HtmlEscaper.
publicHtmlEscapergetHtmlEscaper()publicJsEscapergetJsEscaper()publicUrlEscapergetUrlEscaper()publicstringhtml(string|null $input = null)Escapes a HTML string. Delegates to HtmlEscaper.
publicstringjs(string $input)Escape javascript strings. Delegates to JsEscaper.
publicstringnormalizeEncoding(string $input)Normalizes a string’s encoding to UTF-32. Delegates to HtmlEscaper.
publicstaticsetAttributeEscaper(AttributeEscaper $escaper)publicstaticsetCssEscaper(CssEscaper $escaper)publicstaticsetDoubleEncode(bool $doubleEncode)Sets the double_encode flag. Fans out to all sub-escapers.
publicstaticsetEncoding(string $encoding)Sets the encoding. Fans out to all sub-escapers.
publicstaticsetFlags(int $flags)Sets the htmlspecialchars flags. Fans out to all sub-escapers.
publicstaticsetHtmlEscaper(HtmlEscaper $escaper)publicstaticsetHtmlQuoteType(int $flags)Sets the HTML quoting type for htmlspecialchars.
publicstaticsetJsEscaper(JsEscaper $escaper)publicstaticsetUrlEscaper(UrlEscaper $escaper)publicstringurl(string $input)Escapes a URL. Delegates to UrlEscaper.
Properties
protectedAttributeEscaper$attributeEscaperprotectedCssEscaper$cssEscaperprotectedHtmlEscaper$htmlEscaperprotectedJsEscaper$jsEscaperprotectedUrlEscaper$urlEscaperMethods
__construct()
public function __construct(
string $encoding = "utf-8",
int $flags = 11,
bool $doubleEncode = true
);Constructor. Accepts the legacy scalar params for backward compatibility and fans them out to every sub-escaper so existing code keeps working.
attributes()
public function attributes( mixed $input = null ): string;Escapes a HTML attribute string or array. Delegates to AttributeEscaper.
css()
public function css( string $input ): string;Escape CSS strings. Delegates to CssEscaper.
detectEncoding()
final public function detectEncoding( string $input ): string|null;Detects the character encoding of a string. Delegates to HtmlEscaper.
escapeCss()
public function escapeCss( string $input ): string;escapeHtml()
public function escapeHtml( string|null $input = null ): string;escapeHtmlAttr()
public function escapeHtmlAttr( string|null $input = null ): string;escapeJs()
public function escapeJs( string $input ): string;escapeUrl()
public function escapeUrl( string $input ): string;getAttributeEscaper()
public function getAttributeEscaper(): AttributeEscaper;getCssEscaper()
public function getCssEscaper(): CssEscaper;getEncoding()
public function getEncoding(): string;Returns the encoding from the HtmlEscaper.
getFlags()
public function getFlags(): int;Returns the flags from the HtmlEscaper.
getHtmlEscaper()
public function getHtmlEscaper(): HtmlEscaper;getJsEscaper()
public function getJsEscaper(): JsEscaper;getUrlEscaper()
public function getUrlEscaper(): UrlEscaper;html()
public function html( string|null $input = null ): string;Escapes a HTML string. Delegates to HtmlEscaper.
js()
public function js( string $input ): string;Escape javascript strings. Delegates to JsEscaper.
normalizeEncoding()
final public function normalizeEncoding( string $input ): string;Normalizes a string’s encoding to UTF-32. Delegates to HtmlEscaper.
setAttributeEscaper()
public function setAttributeEscaper( AttributeEscaper $escaper ): static;setCssEscaper()
public function setCssEscaper( CssEscaper $escaper ): static;setDoubleEncode()
public function setDoubleEncode( bool $doubleEncode ): static;Sets the double_encode flag. Fans out to all sub-escapers.
setEncoding()
public function setEncoding( string $encoding ): static;Sets the encoding. Fans out to all sub-escapers.
setFlags()
public function setFlags( int $flags ): static;Sets the htmlspecialchars flags. Fans out to all sub-escapers.
setHtmlEscaper()
public function setHtmlEscaper( HtmlEscaper $escaper ): static;setHtmlQuoteType()
public function setHtmlQuoteType( int $flags ): static;Sets the HTML quoting type for htmlspecialchars.
setJsEscaper()
public function setJsEscaper( JsEscaper $escaper ): static;setUrlEscaper()
public function setUrlEscaper( UrlEscaper $escaper ): static;url()
public function url( string $input ): string;Escapes a URL. Delegates to UrlEscaper.
Html\EscaperFactory
ClassSource on GitHubClass EscaperFactory
Phalcon\Html\EscaperFactory
Method Summary
Methods
newInstance()
public function newInstance(): Escaper;Create a new instance of the object
Html\Escaper\AbstractEscaper
AbstractSource on GitHubShared base for the per-context escaper objects.
@todo Remove in v7. Kept only for backwards compatibility; compose Phalcon\Html\Escaper\Traits\EscaperTrait directly instead of extending this.
Phalcon\Html\Escaper\AbstractEscaper
Uses Phalcon\Html\Escaper\Traits\EscaperTrait
Html\Escaper\AttributeEscaper
ClassSource on GitHubEscapes either a single attribute value (string) or an associative array
of attribute pairs. Boolean true becomes a bare key (e.g. disabled);
false and null skip the entry; arrays are joined with a space.
Phalcon\Html\Escaper\AbstractEscaperPhalcon\Html\Escaper\AttributeEscaper
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
publicstring__invoke(mixed $input = null)publicstringescape(mixed $input = null)protectedstringescapeValue(string $input)Encodes a single key/value via htmlspecialchars.
Methods
__invoke()
public function __invoke( mixed $input = null ): string;escape()
public function escape( mixed $input = null ): string;escapeValue()
protected function escapeValue( string $input ): string;Encodes a single key/value via htmlspecialchars.
Html\Escaper\CssEscaper
ClassSource on GitHubEscapes a string for use inside a CSS value by replacing non-alphanumeric characters with their hexadecimal escape sequence.
Phalcon\Html\Escaper\AbstractEscaperPhalcon\Html\Escaper\CssEscaper
Method Summary
Methods
__invoke()
public function __invoke( string $input ): string;escape()
public function escape( string $input ): string;Html\Escaper\EscaperInterface
InterfaceSource on GitHubInterface for Phalcon\Html\Escaper.
This declares the stable context-escaping surface. The concrete
{@see \Phalcon\Html\Escaper} facade also exposes members that are not part
of this contract - setDoubleEncode(), getFlags(), and the per-context
sub-escaper getters/setters (getHtmlEscaper(), setAttributeEscaper(),
and the rest). Type against the concrete class to reach those.
Phalcon\Html\Escaper\EscaperInterface
Method Summary
publicstringattributes(string $input)Escapes a HTML attribute string.
publicstringcss(string $input)Escape CSS strings by replacing non-alphanumeric chars by their
publicstringgetEncoding()Returns the internal encoding used by the escaper
publicstringhtml(string $input)Escapes a HTML string.
publicstringjs(string $input)Escape Javascript strings by replacing non-alphanumeric chars by their
publicEscaperInterfacesetEncoding(string $encoding)Sets the encoding to be used by the escaper
publicEscaperInterfacesetFlags(int $flags)Sets the HTML quoting type for htmlspecialchars
publicstringurl(string $input)Escapes a URL. Internally uses rawurlencode
Methods
attributes()
public function attributes( string $input ): string;Escapes a HTML attribute string.
The concrete {@see \Phalcon\Html\Escaper} also accepts an array of
attribute pairs and tolerates null: an array is rendered as escaped
key="value" pairs, null and false values are skipped, and true
renders as a bare key. Callers typed against this interface pass a
string. The widened signature lands in the next major.
css()
public function css( string $input ): string;Escape CSS strings by replacing non-alphanumeric chars by their hexadecimal representation
getEncoding()
public function getEncoding(): string;Returns the internal encoding used by the escaper
html()
public function html( string $input ): string;Escapes a HTML string.
The concrete {@see \Phalcon\Html\Escaper} tolerates null, returning an
empty string for it. The nullable signature lands in the next major.
js()
public function js( string $input ): string;Escape Javascript strings by replacing non-alphanumeric chars by their hexadecimal representation
setEncoding()
public function setEncoding( string $encoding ): EscaperInterface;Sets the encoding to be used by the escaper
setFlags()
public function setFlags( int $flags ): EscaperInterface;Sets the HTML quoting type for htmlspecialchars
url()
public function url( string $input ): string;Escapes a URL. Internally uses rawurlencode
Html\Escaper\Exception
ClassSource on GitHubClass Exception
\ExceptionPhalcon\Html\Escaper\Exception
Html\Escaper\HtmlEscaper
ClassSource on GitHubEscapes a string for use as HTML body content via htmlspecialchars.
Phalcon\Html\Escaper\AbstractEscaperPhalcon\Html\Escaper\HtmlEscaper
Method Summary
Methods
__invoke()
public function __invoke( string|null $input = null ): string;escape()
public function escape( string|null $input = null ): string;Html\Escaper\JsEscaper
ClassSource on GitHubEscapes a string for use inside a JavaScript context by replacing non-alphanumeric characters with their hexadecimal escape sequence.
Phalcon\Html\Escaper\AbstractEscaperPhalcon\Html\Escaper\JsEscaper
Method Summary
Methods
__invoke()
public function __invoke( string $input ): string;escape()
public function escape( string $input ): string;Html\Escaper\Traits\EscaperTrait
TraitSource on GitHubShared encoding/flags state and the encoding detection/normalization
utilities used by the per-context escaper objects (HtmlEscaper,
AttributeEscaper, CssEscaper, JsEscaper, UrlEscaper).
Phalcon\Html\Escaper\Traits\EscaperTrait
Used by Phalcon\Html\Escaper\AbstractEscaper
Method Summary
publicstring|nulldetectEncoding(string $input)Detects the character encoding of a string. Special-handling for
publicboolgetDoubleEncode()publicstringgetEncoding()publicintgetFlags()publicstringnormalizeEncoding(string $input)Normalizes a string’s encoding to UTF-32, used by the CSS and JS
publicstaticsetDoubleEncode(bool $doubleEncode)publicstaticsetEncoding(string $encoding)publicstaticsetFlags(int $flags)Properties
protectedbool$doubleEncode = trueprotectedstring$encoding = "utf-8"protectedint$flags = 11ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401
Methods
detectEncoding()
final public function detectEncoding( string $input ): string|null;Detects the character encoding of a string. Special-handling for
chr(172) and chr(128) to chr(159) which fail to be detected by
mb_detect_encoding().
getDoubleEncode()
public function getDoubleEncode(): bool;getEncoding()
public function getEncoding(): string;getFlags()
public function getFlags(): int;normalizeEncoding()
final public function normalizeEncoding( string $input ): string;Normalizes a string’s encoding to UTF-32, used by the CSS and JS escapers before invoking the C-level escape routines.
setDoubleEncode()
public function setDoubleEncode( bool $doubleEncode ): static;setEncoding()
public function setEncoding( string $encoding ): static;setFlags()
public function setFlags( int $flags ): static;Html\Escaper\UrlEscaper
ClassSource on GitHubEscapes a string for use as a URL component via rawurlencode.
Phalcon\Html\Escaper\AbstractEscaperPhalcon\Html\Escaper\UrlEscaper
Uses Phalcon\Traits\Php\UrlTrait
Method Summary
Methods
__invoke()
public function __invoke( string $input ): string;escape()
public function escape( string $input ): string;Html\Exception
ClassSource on GitHubClass Exception
\Exception
Html\Exceptions\AttributeNotRenderable
ClassSource on GitHub\ExceptionPhalcon\Html\ExceptionPhalcon\Html\Exceptions\AttributeNotRenderable
Uses Phalcon\Html\Exception
Method Summary
Methods
__construct()
public function __construct(
string $key,
string $type
);Html\Exceptions\FriendlyTitleConversionFailed
ClassSource on GitHub\ExceptionPhalcon\Html\ExceptionPhalcon\Html\Exceptions\FriendlyTitleConversionFailed
Uses Phalcon\Html\Exception
Method Summary
Methods
__construct()
public function __construct( string $message );Html\Exceptions\InvalidResultsetValue
ClassSource on GitHub\InvalidArgumentExceptionPhalcon\Html\Exceptions\InvalidResultsetValue
Uses InvalidArgumentException
Method Summary
Methods
__construct()
public function __construct();Html\Exceptions\ServiceNotRegistered
ClassSource on GitHub\ExceptionPhalcon\Html\ExceptionPhalcon\Html\Exceptions\ServiceNotRegistered
Uses Phalcon\Html\Exception
Method Summary
Methods
__construct()
public function __construct( string $name );Html\Exceptions\UsingRequiresTwoValues
ClassSource on GitHub\InvalidArgumentExceptionPhalcon\Html\Exceptions\UsingRequiresTwoValues
Uses InvalidArgumentException
Method Summary
Methods
__construct()
public function __construct();Html\Helper\AbstractHelper
AbstractSource on GitHubPhalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractListPhalcon\Html\Helper\AbstractSeriesPhalcon\Html\Helper\AnchorPhalcon\Html\Helper\BasePhalcon\Html\Helper\BodyPhalcon\Html\Helper\BreadcrumbsPhalcon\Html\Helper\ButtonPhalcon\Html\Helper\ClosePhalcon\Html\Helper\ElementPhalcon\Html\Helper\FormPhalcon\Html\Helper\FriendlyTitlePhalcon\Html\Helper\ImgPhalcon\Html\Helper\Input\AbstractGroupPhalcon\Html\Helper\Input\AbstractInputPhalcon\Html\Helper\LabelPhalcon\Html\Helper\PreloadPhalcon\Html\Helper\TagPhalcon\Html\Helper\TitlePhalcon\Html\Helper\VoidTag
Uses Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Exception
Method Summary
public__construct(EscaperInterface $escaper,Doctype|null $doctype = null)AbstractHelper constructor.
protectedstringclose(string $tag,bool $raw = false)Produces a closing tag
protectedstringescapeName(string $name)Removes the characters that end a tag or attribute name (white space,
protectedstringindent()Replicates the indent x times as per indentLevel
protectedarrayinjectAttribute(string $key,string $value,array $attributes)Forces $key => $value to the front of the attributes array,
protectedarrayorderAttributes(array $overrides,array $attributes)Keeps all the attributes sorted - same order all the time
protectedstringrenderArrayElements(array $elements,string $delimiter)Traverses an array and calls the method defined in the first element
protectedstringrenderAttributes(array $attributes)Renders all the attributes
protectedstringrenderElement(string $tag,array $attributes = [])Renders an element
protectedstringrenderFullElement(string $tag,string $text,array $attributes = [],bool $raw = false)Renders an element
protectedstringrenderTag(string $tag,array $attributes = [],string $close = "")Renders a tag
protectedstringselfClose(string $tag,array $attributes = [])Produces a self close tag i.e.
Properties
protectedstring$delimiter = ""protectedDoctype|null$doctype = nullprotectedEscaperInterface$escaperprotectedstring$indent = " "protectedint$indentLevel = 1Methods
__construct()
public function __construct(
EscaperInterface $escaper,
Doctype|null $doctype = null
);AbstractHelper constructor.
close()
protected function close(
string $tag,
bool $raw = false
): string;Produces a closing tag
escapeName()
protected function escapeName( string $name ): string;Removes the characters that end a tag or attribute name (white space, “/”, “=”) and escapes the rest, so a crafted name cannot break out of its position.
indent()
protected function indent(): string;Replicates the indent x times as per indentLevel
injectAttribute()
protected function injectAttribute(
string $key,
string $value,
array $attributes
): array;Forces $key => $value to the front of the attributes array,
removing any existing entry for that key. This guarantees the
attribute is always present and appears first in the rendered output.
orderAttributes()
protected function orderAttributes(
array $overrides,
array $attributes
): array;Keeps all the attributes sorted - same order all the time
renderArrayElements()
protected function renderArrayElements(
array $elements,
string $delimiter
): string;Traverses an array and calls the method defined in the first element with attributes as the second, returning the resulting string
renderAttributes()
protected function renderAttributes( array $attributes ): string;Renders all the attributes
renderElement()
protected function renderElement(
string $tag,
array $attributes = []
): string;Renders an element
renderFullElement()
protected function renderFullElement(
string $tag,
string $text,
array $attributes = [],
bool $raw = false
): string;Renders an element
renderTag()
protected function renderTag(
string $tag,
array $attributes = [],
string $close = ""
): string;Renders a tag
selfClose()
protected function selfClose(
string $tag,
array $attributes = []
): string;Produces a self close tag i.e.
Html\Helper\AbstractList
AbstractSource on GitHubClass AbstractList
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractList
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
publicstatic__invoke(string $indent = " ",string|null $delimiter = null,array $attributes = [])public__toString()Generates and returns the HTML for the list.
protectedstringgetTag()Returns the tag name.
Properties
protectedarray$attributes = []protectedstring$elementTag = "li"protectedarray$store = []Methods
__invoke()
public function __invoke(
string $indent = " ",
string|null $delimiter = null,
array $attributes = []
): static;__toString()
public function __toString();Generates and returns the HTML for the list.
getTag()
abstract protected function getTag(): string;Returns the tag name.
Html\Helper\AbstractSeries
AbstractSource on GitHubPhalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractSeries
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
publicstatic__invoke(string $indent = " ",string|null $delimiter = null)public__toString()Generates and returns the HTML for the list. Entries are sorted by
publicstaticreset()Resets the internal store.
protectedstringgetTag()Returns the tag name.
protectedvoidpushOrPlace(array $entry,int $position = -1)Appends an entry to the store, optionally at a specific integer
Properties
protectedarray$attributes = []protectedarray$store = []Methods
__invoke()
public function __invoke(
string $indent = " ",
string|null $delimiter = null
): static;__toString()
public function __toString();Generates and returns the HTML for the list. Entries are sorted by their integer key first, so an asset registered with a lower position renders before one registered with a higher position regardless of registration order.
reset()
public function reset(): static;Resets the internal store.
getTag()
abstract protected function getTag(): string;Returns the tag name.
pushOrPlace()
protected function pushOrPlace(
array $entry,
int $position = -1
): void;Appends an entry to the store, optionally at a specific integer
position. When $pos is negative the entry is pushed onto the next
available auto-increment slot. When $pos is non-negative the entry
is placed at that key, advancing past any already-occupied slots so
existing entries are not overwritten. The store is ksort()ed in
__toString, so positions act as a sort key, not a strict address.
Html\Helper\Anchor
ClassSource on GitHubClass Anchor
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Anchor
Uses Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Escaper\EscaperInterface
Method Summary
public__construct(EscaperInterface $escaper,Doctype|null $doctype = null,bool $forceRaw = false)publicstring__invoke(string $href,string $text,array $attributes = [],bool $raw = false)Produce a <a> tag
Properties
protectedbool$forceRaw = falseMethods
__construct()
public function __construct(
EscaperInterface $escaper,
Doctype|null $doctype = null,
bool $forceRaw = false
);__invoke()
public function __invoke(
string $href,
string $text,
array $attributes = [],
bool $raw = false
): string;Produce a <a> tag
Html\Helper\Base
ClassSource on GitHubClass Base
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Base
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
Methods
__invoke()
public function __invoke(
string|null $href = null,
array $attributes = []
): string;Produce a <base/> tag.
Html\Helper\Body
ClassSource on GitHubClass Body
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Body
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
Methods
__invoke()
public function __invoke( array $attributes = [] ): string;Produce a <body> tag.
Html\Helper\Breadcrumbs
ClassSource on GitHubThis component offers an easy way to create breadcrumbs for your application.
The resulting HTML when calling render() will have each breadcrumb enclosed
in <li> tags, while the whole string is enclosed in <nav> and <ol> tags.
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Breadcrumbs
Uses Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Escaper\EscaperInterface · Phalcon\Mvc\Url\UrlInterface · Phalcon\Traits\Support\Helper\Str\InterpolateTrait
Method Summary
public__construct(EscaperInterface $escaper,UrlInterface|null $url = null)AbstractHelper constructor.
publicstatic__invoke(string $indent = " ",string|null $delimiter = null)Sets the indent and delimiter and returns the object back.
publicstaticadd(string $text,string $link = "",string $icon = "",array $attributes = [])Adds a new crumb.
publicvoidclear()Clears the crumbs
publicstaticclearAttributes()Clear the attributes of the parent element
publicarraygetAttributes()Get the attributes of the parent element
publicstringgetPrefix()Returns the link prefix.
publicstringgetSeparator()Returns the separator.
publicarraygetTemplate()Return the current template.
publicvoidremove(int $index)Removes crumb by url.
publicstringrender()Renders and outputs breadcrumbs based on previously set template.
publicstaticsetAttributes(array $attributes)Set the attributes for the parent element
publicstaticsetPrefix(string $prefix)Set the link prefix prepended to every non-empty link during rendering.
publicstaticsetSeparator(string $separator)Set the separator
publicstaticsetTemplate(string $main,string $line,string $last)Set the HTML template
publicarraytoArray()Returns the internal breadcrumbs array
Methods
__construct()
public function __construct(
EscaperInterface $escaper,
UrlInterface|null $url = null
);AbstractHelper constructor.
__invoke()
public function __invoke(
string $indent = " ",
string|null $delimiter = null
): static;Sets the indent and delimiter and returns the object back.
add()
public function add(
string $text,
string $link = "",
string $icon = "",
array $attributes = []
): static;Adds a new crumb.
// Adding a crumb with a link
$breadcrumbs->add("Home", "/");
// Adding a crumb with added attributes
$breadcrumbs->add("Home", "/", ["class" => "main"]);
// Adding a crumb without a link (normally the last one)
$breadcrumbs->add("Users");clear()
public function clear(): void;Clears the crumbs
$breadcrumbs->clear()clearAttributes()
public function clearAttributes(): static;Clear the attributes of the parent element
getAttributes()
public function getAttributes(): array;Get the attributes of the parent element
getPrefix()
public function getPrefix(): string;Returns the link prefix.
getSeparator()
public function getSeparator(): string;Returns the separator.
getTemplate()
public function getTemplate(): array;Return the current template.
remove()
public function remove( int $index ): void;Removes crumb by url.
// Remove the second element
$breadcrumbs->remove(2);render()
public function render(): string;Renders and outputs breadcrumbs based on previously set template.
echo $breadcrumbs->render();setAttributes()
public function setAttributes( array $attributes ): static;Set the attributes for the parent element
setPrefix()
public function setPrefix( string $prefix ): static;Set the link prefix prepended to every non-empty link during rendering. When a Url service was injected, calling this method replaces it.
setSeparator()
public function setSeparator( string $separator ): static;Set the separator
setTemplate()
public function setTemplate(
string $main,
string $line,
string $last
): static;Set the HTML template
toArray()
public function toArray(): array;Returns the internal breadcrumbs array
Html\Helper\Button
ClassSource on GitHubClass Button
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Button
Uses Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Escaper\EscaperInterface
Method Summary
public__construct(EscaperInterface $escaper,Doctype|null $doctype = null,bool $forceRaw = false)publicstring__invoke(string $text,array $attributes = [],bool $raw = false)Produce a <button> tag.
Properties
protectedbool$forceRaw = falseMethods
__construct()
public function __construct(
EscaperInterface $escaper,
Doctype|null $doctype = null,
bool $forceRaw = false
);__invoke()
public function __invoke(
string $text,
array $attributes = [],
bool $raw = false
): string;Produce a <button> tag.
Html\Helper\Close
ClassSource on GitHubClass Close
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Close
Method Summary
Methods
__invoke()
public function __invoke(
string $tag,
bool $raw = false
): string;Produce a </...> tag.
Html\Helper\Doctype
ClassSource on GitHubCreates Doctype tags
Phalcon\Html\Helper\Doctype
Method Summary
public__construct()publicstatic__invoke(int $type = self::HTML5,string $delimiter = "\n")Produce a <doctype> tag
publicstring__toString()publicintgetType()Constants
intHTML32 = 1intHTML401_FRAMESET = 4intHTML401_STRICT = 2intHTML401_TRANSITIONAL = 3intHTML5 = 5intXHTML10_FRAMESET = 8intXHTML10_STRICT = 6intXHTML10_TRANSITIONAL = 7intXHTML11 = 9intXHTML20 = 10intXHTML5 = 11Methods
__construct()
public function __construct();__invoke()
public function __invoke(
int $type = self::HTML5,
string $delimiter = "\n"
): static;Produce a <doctype> tag
__toString()
public function __toString(): string;getType()
public function getType(): int;Html\Helper\Element
ClassSource on GitHubClass Element
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Element
Uses Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Escaper\EscaperInterface
Method Summary
public__construct(EscaperInterface $escaper,Doctype|null $doctype = null,bool $forceRaw = false)publicstring__invoke(string $tag,string $text,array $attributes = [],bool $raw = false)Produce a tag.
Properties
protectedbool$forceRaw = falseMethods
__construct()
public function __construct(
EscaperInterface $escaper,
Doctype|null $doctype = null,
bool $forceRaw = false
);__invoke()
public function __invoke(
string $tag,
string $text,
array $attributes = [],
bool $raw = false
): string;Produce a tag.
Html\Helper\Form
ClassSource on GitHubClass Form
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Form
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
Methods
__invoke()
public function __invoke( array $attributes = [] ): string;Produce a <form> tag.
Html\Helper\FriendlyTitle
ClassSource on GitHubConverts text to a URL-friendly slug.
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\FriendlyTitle
Uses Exception · Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Exceptions\FriendlyTitleConversionFailed · Phalcon\Support\Helper\Str\Friendly
Method Summary
public__construct(EscaperInterface $escaper)publicstring__invoke(string $text,string $separator = "-",bool $lowercase = true,mixed $replace = null)Properties
protectedFriendly$friendlyMethods
__construct()
public function __construct( EscaperInterface $escaper );__invoke()
public function __invoke(
string $text,
string $separator = "-",
bool $lowercase = true,
mixed $replace = null
): string;Html\Helper\Img
ClassSource on GitHubClass Img
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Img
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
Methods
__invoke()
public function __invoke(
string $src,
array $attributes = []
): string;Produce a <img> tag.
Html\Helper\Input\AbstractChecked
AbstractSource on GitHubShared base for inputs that can be checked: <input type="checkbox"> and
<input type="radio">. Holds the optional surrounding <label> markup,
the unchecked companion hidden input, and the rule that decides whether
the rendered tag carries checked="checked".
The match between checked and value is loose (==) by default so that
mixed int/string form input round-trips correctly (e.g. value=0 against
checked="0"). Strict (===) matching is available via strict(true).
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Input\AbstractInputPhalcon\Html\Helper\Input\AbstractChecked
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
public__toString()Returns the HTML for the input, optionally surrounded by the label
publicstaticlabel(array $attributes = [])Attaches a wrapping <label> to the element. The supplied attributes
publicstaticstrict(bool $flag = true)Toggles strict (===) comparison between the checked attribute and
protectedvoidprocessChecked()Decides whether the rendered tag carries checked="checked". Two
protectedstringprocessUnchecked()Returns the markup for the optional hidden companion input that lets
Properties
protectedarray$label = [...]protectedbool$strict = falseMethods
__toString()
public function __toString();Returns the HTML for the input, optionally surrounded by the label
fragment configured via label() and preceded by the hidden companion
input emitted when an unchecked attribute is supplied.
label()
public function label( array $attributes = [] ): static;Attaches a wrapping <label> to the element. The supplied attributes
are merged with a default for pointing at the input’s id. A text
pseudo-attribute, if present, becomes the label text and is stripped
from the rendered attributes.
strict()
public function strict( bool $flag = true ): static;Toggles strict (===) comparison between the checked attribute and
the value attribute when deciding whether to render the input as
checked. Defaults to loose (==), which matches typical form-input
round-tripping where types may differ between the source data and the
value rendered into the markup.
processChecked()
protected function processChecked(): void;Decides whether the rendered tag carries checked="checked". Two
paths qualify as checked: an unconditional opt-in via
["checked" => "checked"] (case-insensitive) or ["checked" => true],
and a value-match path where the supplied checked attribute equals
the input’s value (== by default, === under strict(true)).
processUnchecked()
protected function processUnchecked(): string;Returns the markup for the optional hidden companion input that lets a checkbox/radio submit a value when unchecked.
Html\Helper\Input\AbstractGroup
AbstractSource on GitHubShared base for rendering a group of same-named inputs (checkbox or radio) from an options array.
Each option in the $options array may be either:
- a scalar string label: [‘value’ => ‘Label text’]
- a rich definition: [‘value’ => [‘label’ => ‘Label text’, ‘disabled’ => true, …]]
The $checked parameter is resolved by the concrete subclass:
- CheckboxGroup compares against an array of selected values
- RadioGroup compares against a single scalar value
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Input\AbstractGroup
Uses Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Helper\AbstractHelper
Method Summary
publicstatic__invoke(string $name,array $options,mixed $checked = null,array $attributes = [])publicstring__toString()Renders the group of inputs as a string.
protectedboolisChecked(string $value)Determines whether the given value is considered checked.
protectedstringrenderItem(string $value,mixed $definition)Renders a single input + optional label pair.
Properties
protectedmixed$checked = nullprotectedstring$name = ""protectedarray$options = []protectedarray$sharedAttributes = []protectedstring$type = "checkbox"Methods
__invoke()
public function __invoke(
string $name,
array $options,
mixed $checked = null,
array $attributes = []
): static;__toString()
public function __toString(): string;Renders the group of inputs as a string.
isChecked()
abstract protected function isChecked( string $value ): bool;Determines whether the given value is considered checked.
renderItem()
protected function renderItem(
string $value,
mixed $definition
): string;Renders a single input + optional label pair.
Html\Helper\Input\AbstractInput
AbstractSource on GitHubClass AbstractInput
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Input\AbstractInput
Uses Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Helper\AbstractHelper · Phalcon\Html\Helper\Doctype
Method Summary
publicstatic__invoke(string $name,string|null $value = null,array $attributes = [])public__toString()Returns the HTML for the input.
publicstaticsetValue(string|null $value = null)Sets the value of the element
Properties
protectedarray$attributes = []protectedstring$type = "text"Methods
__invoke()
public function __invoke(
string $name,
string|null $value = null,
array $attributes = []
): static;__toString()
public function __toString();Returns the HTML for the input.
setValue()
public function setValue( string|null $value = null ): static;Sets the value of the element
Html\Helper\Input\Checkbox
ClassSource on GitHubRenders an <input type="checkbox">. Behavior (label wrapping, unchecked
companion, loose-by-default checked match) lives in AbstractChecked.
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Input\AbstractInputPhalcon\Html\Helper\Input\AbstractCheckedPhalcon\Html\Helper\Input\Checkbox
Properties
protectedstring$type = "checkbox"Html\Helper\Input\CheckboxGroup
ClassSource on GitHubRenders a group of <input type="checkbox"> elements from an options array.
The $checked parameter should be an array of selected values, or a single scalar value (treated as a one-element array).
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Input\AbstractGroupPhalcon\Html\Helper\Input\CheckboxGroup
Method Summary
Properties
protectedstring$type = "checkbox"Methods
isChecked()
protected function isChecked( string $value ): bool;Returns true when $value appears in the checked list.
Html\Helper\Input\Generic
ClassSource on GitHubGeneric input helper. The HTML5 type attribute is supplied via the
constructor, which means the TagFactory can register a single class
for all type-string-only inputs (color, date, email, hidden, number, …)
and differentiate them through the recipe map. The type can also be
changed after construction via setType().
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Input\AbstractInputPhalcon\Html\Helper\Input\Generic
Uses Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Helper\Doctype
Method Summary
public__construct(EscaperInterface $escaper,Doctype|null $doctype = null,string $type = "text")publicAbstractInputsetType(string $type)Sets the type of the input.
Methods
__construct()
public function __construct(
EscaperInterface $escaper,
Doctype|null $doctype = null,
string $type = "text"
);setType()
public function setType( string $type ): AbstractInput;Sets the type of the input.
Html\Helper\Input\Radio
ClassSource on GitHubRenders an <input type="radio">. Behavior (label wrapping, unchecked
companion, loose-by-default checked match) lives in AbstractChecked.
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Input\AbstractInputPhalcon\Html\Helper\Input\AbstractCheckedPhalcon\Html\Helper\Input\Radio
Properties
protectedstring$type = "radio"Html\Helper\Input\RadioGroup
ClassSource on GitHubRenders a group of <input type="radio"> elements from an options array.
The $checked parameter should be a single scalar value matching the selected option’s value attribute.
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Input\AbstractGroupPhalcon\Html\Helper\Input\RadioGroup
Method Summary
Properties
protectedstring$type = "radio"Methods
isChecked()
protected function isChecked( string $value ): bool;Returns true when $value loosely equals the checked scalar.
Html\Helper\Input\Select
ClassSource on GitHubClass Select
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractListPhalcon\Html\Helper\Input\Select
Uses Phalcon\Contracts\Html\Helper\Input\SelectData · Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Helper\AbstractList
Method Summary
publicstaticadd(string $text,string|null $value = null,array $attributes = [],bool $raw = false)Add an element to the list
publicstaticaddPlaceholder(string $text,string|null $value = null,array $attributes = [],bool $raw = false)Add a placeholder to the element
publicstaticfromData(SelectData $data)Populates the select from a data provider.
publicstaticoptGroup(string|null $label = null,array $attributes = [])Creates an option group
publicstaticplaceholder(string $text)Adds a non-selectable placeholder option as the first entry. Renders
publicstaticselected(string $selected)publicstaticstrict(bool $flag = true)Toggles strict (===) comparison between an option’s value and
protectedstringgetTag()protectedstringoptGroupEnd()protectedstringoptGroupStart(string $label,array $attributes)Properties
protectedstring$elementTag = "option"protectedbool$inOptGroup = falseprotectedstring$selected = ""protectedbool$strict = falseMethods
add()
public function add(
string $text,
string|null $value = null,
array $attributes = [],
bool $raw = false
): static;Add an element to the list
addPlaceholder()
public function addPlaceholder(
string $text,
string|null $value = null,
array $attributes = [],
bool $raw = false
): static;Add a placeholder to the element
fromData()
public function fromData( SelectData $data ): static;Populates the select from a data provider.
Flat entries: key = option value, value = label string. Optgroup entries: key = group label, value = [value => label] array.
optGroup()
public function optGroup(
string|null $label = null,
array $attributes = []
): static;Creates an option group
placeholder()
public function placeholder( string $text ): static;Adds a non-selectable placeholder option as the first entry. Renders
as <option value="" disabled selected>$text</option>, matching the
common HTML idiom for “Choose…”-style prompts.
selected()
public function selected( string $selected ): static;strict()
public function strict( bool $flag = true ): static;Toggles strict (===) comparison between an option’s value and
the previously stored selected value. Defaults to loose (==),
matching the round-tripping fix in AbstractChecked so mixed
int/string form data marks the right option as selected.
getTag()
protected function getTag(): string;optGroupEnd()
protected function optGroupEnd(): string;optGroupStart()
protected function optGroupStart(
string $label,
array $attributes
): string;Html\Helper\Input\Select\ArrayData
ClassSource on GitHubWraps a plain PHP array as a SELECT data provider.
Keys are option values; string values are labels; array values define optgroups.
Phalcon\Html\Helper\Input\Select\ArrayData- implementsPhalcon\Contracts\Html\Helper\Input\SelectData
Uses Phalcon\Contracts\Html\Helper\Input\SelectData · Phalcon\Contracts\Html\HtmlTypes
Method Summary
public__construct(array $data = [],array $attributes = [])publicarraygetAttributes()publicarraygetOptions()Properties
protectedarray$attributes = []protectedarray$data = []Methods
__construct()
public function __construct(
array $data = [],
array $attributes = []
);getAttributes()
public function getAttributes(): array;getOptions()
public function getOptions(): array;Html\Helper\Input\Select\ResultsetData
ClassSource on GitHubPhalcon\Html\Helper\Input\Select\ResultsetData- implementsPhalcon\Contracts\Html\Helper\Input\SelectData
Uses Phalcon\Contracts\Html\Helper\Input\SelectData · Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Exceptions\InvalidResultsetValue · Phalcon\Html\Exceptions\UsingRequiresTwoValues · Phalcon\Mvc\Model\ResultsetInterface
Method Summary
public__construct(ResultsetInterface $resultset,array $using,array $attributesMap = [])publicarraygetAttributes()Returns per-option attribute maps, keyed by option value.
publicarraygetOptions()protectedreadField(mixed $option,string $field)Reads a property from the row, supporting both objects (via
protectedvoidresolve()Walks the resultset once, building both the option map and the
Properties
protectedarray$attributesMap = []protectedhtml_select_attributes|null$resolvedAttributes = nullprotectedhtml_select_options|null$resolvedOptions = nullprotectedResultsetInterface$resultsetprotectedarray$using = []Methods
__construct()
public function __construct(
ResultsetInterface $resultset,
array $using,
array $attributesMap = []
);getAttributes()
public function getAttributes(): array;Returns per-option attribute maps, keyed by option value.
getOptions()
public function getOptions(): array;readField()
protected function readField(
mixed $option,
string $field
);Reads a property from the row, supporting both objects (via
readAttribute when available) and plain arrays.
resolve()
protected function resolve(): void;Walks the resultset once, building both the option map and the
per-option resolved attribute map. Closures in attributesMap
receive the current row; static values are passed through.
false or null values skip the attribute entirely.
Html\Helper\Input\Textarea
ClassSource on GitHubClass Textarea
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Input\AbstractInputPhalcon\Html\Helper\Input\Textarea
Uses Phalcon\Html\Exception
Method Summary
Properties
protectedstring$type = "textarea"Methods
__toString()
public function __toString();Returns the HTML for the input.
Html\Helper\Label
ClassSource on GitHubClass Label
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Label
Uses Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Escaper\EscaperInterface
Method Summary
public__construct(EscaperInterface $escaper,Doctype|null $doctype = null,bool $forceRaw = false)publicstring__invoke(string $label,array $attributes = [],bool $raw = false)Produce a <label> tag.
Properties
protectedbool$forceRaw = falseMethods
__construct()
public function __construct(
EscaperInterface $escaper,
Doctype|null $doctype = null,
bool $forceRaw = false
);__invoke()
public function __invoke(
string $label,
array $attributes = [],
bool $raw = false
): string;Produce a <label> tag.
Html\Helper\Link
ClassSource on GitHubCreates <link> tags
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractSeriesPhalcon\Html\Helper\StylePhalcon\Html\Helper\Link
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
publicstaticadd(string $url,array $attributes = [],int $position = -1)Add an element to the list
protectedarraygetAttributes(string $url,array $attributes)Returns the necessary attributes
protectedstringgetTag()Methods
add()
public function add(
string $url,
array $attributes = [],
int $position = -1
): static;Add an element to the list
getAttributes()
protected function getAttributes(
string $url,
array $attributes
): array;Returns the necessary attributes
getTag()
protected function getTag(): string;Html\Helper\Meta
ClassSource on GitHubClass Meta
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractSeriesPhalcon\Html\Helper\Meta
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
publicstaticadd(array $attributes = [],int $position = -1)Add an element to the list
publicstaticaddHttp(string $httpEquiv,string $content,int $position = -1)publicstaticaddName(string $name,string $content,int $position = -1)publicstaticaddProperty(string $name,string $content,int $position = -1)protectedstringgetTag()Methods
add()
public function add(
array $attributes = [],
int $position = -1
): static;Add an element to the list
addHttp()
public function addHttp(
string $httpEquiv,
string $content,
int $position = -1
): static;addName()
public function addName(
string $name,
string $content,
int $position = -1
): static;addProperty()
public function addProperty(
string $name,
string $content,
int $position = -1
): static;getTag()
protected function getTag(): string;Html\Helper\Ol
ClassSource on GitHubClass Ol
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractListPhalcon\Html\Helper\Ol
Uses Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Escaper\EscaperInterface
Method Summary
public__construct(EscaperInterface $escaper,Doctype|null $doctype = null,bool $forceRaw = false)publicstaticadd(string $text,array $attributes = [],bool $raw = false)Add an element to the list
protectedstringgetTag()Properties
protectedbool$forceRaw = falseMethods
__construct()
public function __construct(
EscaperInterface $escaper,
Doctype|null $doctype = null,
bool $forceRaw = false
);add()
public function add(
string $text,
array $attributes = [],
bool $raw = false
): static;Add an element to the list
getTag()
protected function getTag(): string;Html\Helper\Preload
ClassSource on GitHubGenerates a <link rel=“preload”> tag for resource hinting. If a ResponseInterface is provided, also sets the HTTP Link header.
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Preload
Uses Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Link\Link · Phalcon\Html\Link\Serializer\Header · Phalcon\Http\ResponseInterface
Method Summary
public__construct(EscaperInterface $escaper,ResponseInterface|null $response = null)publicstring__invoke(string $href,string $type = "style",array $attributes = [])Properties
protectedResponseInterface|null$response = nullMethods
__construct()
public function __construct(
EscaperInterface $escaper,
ResponseInterface|null $response = null
);__invoke()
public function __invoke(
string $href,
string $type = "style",
array $attributes = []
): string;Html\Helper\Script
ClassSource on GitHubClass Script
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractSeriesPhalcon\Html\Helper\Script
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
publicstaticadd(string $url,array $attributes = [],int $position = -1)Add an element to the list
publicvoidbeginInternal()Begins capturing inline script content via output buffering. Pair
publicstaticendInternal(array $attributes = [],int $position = -1)Closes an inline-script buffer opened by beginInternal() and adds
protectedarraygetAttributes(string $url,array $attributes)Returns the necessary attributes
protectedstringgetTag()Methods
add()
public function add(
string $url,
array $attributes = [],
int $position = -1
): static;Add an element to the list
beginInternal()
public function beginInternal(): void;Begins capturing inline script content via output buffering. Pair
with endInternal() to close the buffer and append the captured
markup as a <script>...</script> block in the asset stack.
endInternal()
public function endInternal(
array $attributes = [],
int $position = -1
): static;Closes an inline-script buffer opened by beginInternal() and adds
the captured content as a <script>...</script> entry. Any
attributes supplied are placed on the wrapping tag. The script body
is treated as raw HTML (it is JavaScript, not user-supplied text).
getAttributes()
protected function getAttributes(
string $url,
array $attributes
): array;Returns the necessary attributes
getTag()
protected function getTag(): string;Html\Helper\Style
ClassSource on GitHubClass Style
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractSeriesPhalcon\Html\Helper\Style
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
publicstaticadd(string $url,array $attributes = [],int $position = -1)Add an element to the list
publicstaticsetStyle(bool $flag)Sets if this is a style or link tag
protectedarraygetAttributes(string $url,array $attributes)Returns the necessary attributes
protectedstringgetTag()Methods
add()
public function add(
string $url,
array $attributes = [],
int $position = -1
): static;Add an element to the list
setStyle()
public function setStyle( bool $flag ): static;Sets if this is a style or link tag
getAttributes()
protected function getAttributes(
string $url,
array $attributes
): array;Returns the necessary attributes
getTag()
protected function getTag(): string;Html\Helper\Tag
ClassSource on GitHubGeneric open-tag escape hatch. Renders just <name attr="..."> for any
tag name without a dedicated helper. For an open + content + close tag
use Element instead. For self-closing void tags (img, br, hr, etc.)
use VoidTag.
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Tag
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
Methods
__invoke()
public function __invoke(
string $name,
array $attributes = []
): string;Html\Helper\Title
ClassSource on GitHubClass Title
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Title
Uses Phalcon\Html\Exception
Method Summary
publicstatic__invoke(string $indent = " ",string|null $delimiter = null)Sets the separator and returns the object back
public__toString()Returns the title tags
publicstaticappend(string $text,bool $raw = false)Appends text to current document title
publicstringget()Returns the title
publicstaticprepend(string $text,bool $raw = false)Prepends text to current document title
publicstaticset(string $text,bool $raw = false)Sets the title
publicstaticsetSeparator(string $separator,bool $raw = false)Sets the separator
Properties
protectedarray$append = []protectedarray$prepend = []Untyped on purpose. A typed array default is shared by all instances
and prepend() mutates it in place, which corrupts the heap. See
team/Planning/2026-08-20-zephir-typed-array-property-shared-default.md
protectedstring$separator = ""protectedstring$title = ""Methods
__invoke()
public function __invoke(
string $indent = " ",
string|null $delimiter = null
): static;Sets the separator and returns the object back
__toString()
public function __toString();Returns the title tags
append()
public function append(
string $text,
bool $raw = false
): static;Appends text to current document title
get()
public function get(): string;Returns the title
prepend()
public function prepend(
string $text,
bool $raw = false
): static;Prepends text to current document title
set()
public function set(
string $text,
bool $raw = false
): static;Sets the title
setSeparator()
public function setSeparator(
string $separator,
bool $raw = false
): static;Sets the separator
Html\Helper\Ul
ClassSource on GitHubClass Ul
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractListPhalcon\Html\Helper\OlPhalcon\Html\Helper\Ul
Method Summary
Methods
getTag()
protected function getTag(): string;Html\Helper\VoidTag
ClassSource on GitHubGeneric void-tag escape hatch. Renders a self-closing tag for any name
without a dedicated helper. The trailing / is emitted only for XHTML
doctypes, matching the Input/AbstractInput::__toString convention.
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\VoidTag
Uses Phalcon\Contracts\Html\HtmlTypes
Method Summary
Methods
__invoke()
public function __invoke(
string $name,
array $attributes = []
): string;Html\Link\AbstractLink
AbstractSource on GitHubPhalcon\Html\Link\AbstractLink
Uses Phalcon\Contracts\Html\Link\LinkTypes · Phalcon\Support\Collection
Method Summary
public__construct(string $rel = "",string $href = "",array $attributes = [])Link constructor.
protectedarraydoGetAttributes()Returns a list of attributes that describe the target URI.
protectedstringdoGetHref()Returns the target of the link.
protectedarraydoGetRels()Returns the relationship type(s) of the link.
protectedbooldoIsTemplated()Returns whether this is a templated link. True if this link object is
protectedstaticdoWithAttribute(string $key,mixed $value)protectedstaticdoWithHref(string $href)protectedstaticdoWithRel(string $key)protectedstaticdoWithoutAttribute(string $key)protectedstaticdoWithoutRel(string $key)protectedboolhrefIsTemplated(string $href)Determines if a href is a templated link or not.
Properties
protectedCollection$attributesprotectedstring$href = ""protectedCollection$relsprotectedbool$templated = falseMethods
__construct()
public function __construct(
string $rel = "",
string $href = "",
array $attributes = []
);Link constructor.
doGetAttributes()
protected function doGetAttributes(): array;Returns a list of attributes that describe the target URI.
A key-value list of attributes, where the key is a string and the value is either a PHP primitive or an array of PHP strings. If no values are found an empty array MUST be returned.
doGetHref()
protected function doGetHref(): string;Returns the target of the link.
The target link must be one of:
- An absolute URI, as defined by RFC 5988.
- A relative URI, as defined by RFC 5988. The base of the relative link is assumed to be known based on context by the client.
- A URI template as defined by RFC 6570.
If a URI template is returned, isTemplated() MUST return True.
doGetRels()
protected function doGetRels(): array;Returns the relationship type(s) of the link.
This method returns 0 or more relationship types for a link, expressed as an array of strings.
doIsTemplated()
protected function doIsTemplated(): bool;Returns whether this is a templated link. True if this link object is templated, False otherwise.
doWithAttribute()
protected function doWithAttribute(
string $key,
mixed $value
): static;doWithHref()
protected function doWithHref( string $href ): static;doWithRel()
protected function doWithRel( string $key ): static;doWithoutAttribute()
protected function doWithoutAttribute( string $key ): static;doWithoutRel()
protected function doWithoutRel( string $key ): static;hrefIsTemplated()
protected function hrefIsTemplated( string $href ): bool;Determines if a href is a templated link or not.
@see https://tools.ietf.org/html/rfc6570
Html\Link\AbstractLinkProvider
AbstractSource on GitHubPhalcon\Html\Link\AbstractLinkProvider
Uses Phalcon\Contracts\Html\Link\LinkTypes · Phalcon\Html\Link\Interfaces\LinkInterface
Method Summary
public__construct(array $links = [])LinkProvider constructor.
protectedarraydoGetLinks()Returns an iterable of LinkInterface objects.
protectedarraydoGetLinksByRel(string $rel)Returns an iterable of LinkInterface objects that have a specific
protectedstaticdoWithLink(mixed $link)Returns an instance with the specified link included.
protectedstaticdoWithoutLink(mixed $link)Returns an instance with the specified link removed.
protectedstringgetKey(mixed $link)Returns the object hash key
Properties
protectedarray$links = []Methods
__construct()
public function __construct( array $links = [] );LinkProvider constructor.
The guard keeps foreign objects out of the collection. It stays live in the Zephir implementation, where the array is untyped.
doGetLinks()
protected function doGetLinks(): array;Returns an iterable of LinkInterface objects.
The iterable may be an array or any PHP \Traversable object. If no links are available, an empty array or \Traversable MUST be returned.
doGetLinksByRel()
protected function doGetLinksByRel( string $rel ): array;Returns an iterable of LinkInterface objects that have a specific relationship.
The iterable may be an array or any PHP \Traversable object. If no links with that relationship are available, an empty array or \Traversable MUST be returned.
doWithLink()
protected function doWithLink( mixed $link ): static;Returns an instance with the specified link included.
If the specified link is already present, this method MUST return normally without errors. The link is present if $link is === identical to a link object already in the collection.
doWithoutLink()
protected function doWithoutLink( mixed $link ): static;Returns an instance with the specified link removed.
If the specified link is not present, this method MUST return normally without errors. The link is present if $link is === identical to a link object already in the collection.
getKey()
protected function getKey( mixed $link ): string;Returns the object hash key
Html\Link\EvolvableLink
ClassSource on GitHubClass Phalcon\Html\Link\EvolvableLink
Phalcon\Html\Link\AbstractLinkPhalcon\Html\Link\LinkPhalcon\Html\Link\EvolvableLink- implementsPhalcon\Html\Link\Interfaces\EvolvableLinkInterface
Uses Phalcon\Contracts\Html\Link\LinkTypes · Phalcon\Html\Link\Interfaces\EvolvableLinkInterface
Method Summary
publicstaticwithAttribute(mixed $attribute,mixed $value)Returns an instance with the specified attribute added.
publicstaticwithHref(string $href)Returns an instance with the specified href.
publicstaticwithRel(string $rel)Returns an instance with the specified relationship included.
publicstaticwithoutAttribute(string $attribute)Returns an instance with the specified attribute excluded.
publicstaticwithoutRel(string $rel)Returns an instance with the specified relationship excluded.
Methods
withAttribute()
public function withAttribute(
mixed $attribute,
mixed $value
): static;Returns an instance with the specified attribute added.
If the specified attribute is already present, it will be overwritten with the new value.
withHref()
public function withHref( string $href ): static;Returns an instance with the specified href.
An implementing library SHOULD evaluate a passed object to a string immediately rather than waiting for it to be returned later.
withRel()
public function withRel( string $rel ): static;Returns an instance with the specified relationship included.
If the specified rel is already present, this method MUST return normally without errors, but without adding the rel a second time.
withoutAttribute()
public function withoutAttribute( string $attribute ): static;Returns an instance with the specified attribute excluded.
If the specified attribute is not present, this method MUST return normally without errors.
withoutRel()
public function withoutRel( string $rel ): static;Returns an instance with the specified relationship excluded.
If the specified rel is not present, this method MUST return normally without errors.
Html\Link\EvolvableLinkProvider
ClassSource on GitHubClass Phalcon\Html\Link\EvolvableLinkProvider
Phalcon\Html\Link\AbstractLinkProviderPhalcon\Html\Link\LinkProviderPhalcon\Html\Link\EvolvableLinkProvider- implementsPhalcon\Html\Link\Interfaces\EvolvableLinkProviderInterface
Uses Phalcon\Contracts\Html\Link\LinkTypes · Phalcon\Html\Link\Interfaces\EvolvableLinkProviderInterface · Phalcon\Html\Link\Interfaces\LinkInterface
Method Summary
publicstaticwithLink(LinkInterface $link)Returns an instance with the specified link included.
publicstaticwithoutLink(LinkInterface $link)Returns an instance with the specified link removed.
Methods
withLink()
public function withLink( LinkInterface $link ): static;Returns an instance with the specified link included.
If the specified link is already present, this method MUST return normally without errors. The link is present if $link is === identical to a link object already in the collection.
withoutLink()
public function withoutLink( LinkInterface $link ): static;Returns an instance with the specified link removed.
If the specified link is not present, this method MUST return normally without errors. The link is present if $link is === identical to a link object already in the collection.
Html\Link\Interfaces\EvolvableLinkInterface
InterfaceSource on GitHubAn evolvable link value object.
Phalcon\Html\Link\Interfaces\LinkInterfacePhalcon\Html\Link\Interfaces\EvolvableLinkInterface
Method Summary
publicEvolvableLinkInterfacewithAttribute(string $attribute,string $value)Returns an instance with the specified attribute added.
publicEvolvableLinkInterfacewithHref(string $href)Returns an instance with the specified href.
publicEvolvableLinkInterfacewithRel(string $rel)Returns an instance with the specified relationship included.
publicEvolvableLinkInterfacewithoutAttribute(string $attribute)Returns an instance with the specified attribute excluded.
publicEvolvableLinkInterfacewithoutRel(string $rel)Returns an instance with the specified relationship excluded.
Methods
withAttribute()
public function withAttribute(
string $attribute,
string $value
): EvolvableLinkInterface;Returns an instance with the specified attribute added.
If the specified attribute is already present, it will be overwritten with the new value.
withHref()
public function withHref( string $href ): EvolvableLinkInterface;Returns an instance with the specified href.
An implementing library SHOULD evaluate a passed object to a string immediately rather than waiting for it to be returned later.
withRel()
public function withRel( string $rel ): EvolvableLinkInterface;Returns an instance with the specified relationship included.
If the specified rel is already present, this method MUST return normally without errors, but without adding the rel a second time.
withoutAttribute()
public function withoutAttribute( string $attribute ): EvolvableLinkInterface;Returns an instance with the specified attribute excluded.
If the specified attribute is not present, this method MUST return normally without errors.
withoutRel()
public function withoutRel( string $rel ): EvolvableLinkInterface;Returns an instance with the specified relationship excluded.
If the specified rel is already not present, this method MUST return normally without errors.
Html\Link\Interfaces\EvolvableLinkProviderInterface
InterfaceSource on GitHubAn evolvable link provider value object.
Phalcon\Html\Link\Interfaces\LinkProviderInterfacePhalcon\Html\Link\Interfaces\EvolvableLinkProviderInterface
Method Summary
publicEvolvableLinkProviderInterfacewithLink(LinkInterface $link)Returns an instance with the specified link included.
publicEvolvableLinkProviderInterfacewithoutLink(LinkInterface $link)Returns an instance with the specified link removed.
Methods
withLink()
public function withLink( LinkInterface $link ): EvolvableLinkProviderInterface;Returns an instance with the specified link included.
If the specified link is already present, this method MUST return normally without errors. The link is present if $link is === identical to a link object already in the collection.
withoutLink()
public function withoutLink( LinkInterface $link ): EvolvableLinkProviderInterface;Returns an instance with the specified link removed.
If the specified link is not present, this method MUST return normally without errors. The link is present if $link is === identical to a link object already in the collection.
Html\Link\Interfaces\LinkInterface
InterfaceSource on GitHubA readable link object.
Phalcon\Html\Link\Interfaces\LinkInterface
Uses Phalcon\Contracts\Html\Link\LinkTypes
Method Summary
publicarraygetAttributes()Returns a list of attributes that describe the target URI.
publicstringgetHref()Returns the target of the link.
publicarraygetRels()Returns the relationship type(s) of the link.
publicboolisTemplated()Returns whether this is a templated link.
Methods
getAttributes()
public function getAttributes(): array;Returns a list of attributes that describe the target URI.
A key-value list of attributes, where the key is a string and the value is either a PHP primitive or an array of PHP strings. If no values are found an empty array MUST be returned.
getHref()
public function getHref(): string;Returns the target of the link.
The target link must be one of:
- An absolute URI, as defined by RFC 5988.
- A relative URI, as defined by RFC 5988. The base of the relative link is assumed to be known based on context by the client.
- A URI template as defined by RFC 6570.
If a URI template is returned, isTemplated() MUST return True.
getRels()
public function getRels(): array;Returns the relationship type(s) of the link.
This method returns 0 or more relationship types for a link, expressed as an array of strings.
isTemplated()
public function isTemplated(): bool;Returns whether this is a templated link.
Html\Link\Interfaces\LinkProviderInterface
InterfaceSource on GitHubA link provider object.
Phalcon\Html\Link\Interfaces\LinkProviderInterface
Uses Phalcon\Contracts\Html\Link\LinkTypes
Method Summary
publicarraygetLinks()Returns an array of LinkInterface objects.
publicarraygetLinksByRel(string $rel)Returns an array of LinkInterface objects that have a specific
Methods
getLinks()
public function getLinks(): array;Returns an array of LinkInterface objects.
getLinksByRel()
public function getLinksByRel( string $rel ): array;Returns an array of LinkInterface objects that have a specific relationship.
Html\Link\Link
ClassSource on GitHubClass Phalcon\Html\Link\Link
Phalcon\Html\Link\AbstractLinkPhalcon\Html\Link\Link- implementsPhalcon\Html\Link\Interfaces\LinkInterface
Uses Phalcon\Contracts\Html\Link\LinkTypes · Phalcon\Html\Link\Interfaces\LinkInterface
Method Summary
publicarraygetAttributes()Returns a list of attributes that describe the target URI.
publicstringgetHref()Returns the target of the link.
publicarraygetRels()Returns the relationship type(s) of the link.
publicboolisTemplated()Returns whether this is a templated link.
Methods
getAttributes()
public function getAttributes(): array;Returns a list of attributes that describe the target URI.
A key-value list of attributes, where the key is a string and the value is either a PHP primitive or an array of PHP strings. If no values are found an empty array MUST be returned.
getHref()
public function getHref(): string;Returns the target of the link.
The target link must be one of:
- An absolute URI, as defined by RFC 5988.
- A relative URI, as defined by RFC 5988. The base of the relative link is assumed to be known based on context by the client.
- A URI template as defined by RFC 6570.
If a URI template is returned, isTemplated() MUST return True.
getRels()
public function getRels(): array;Returns the relationship type(s) of the link.
This method returns 0 or more relationship types for a link, expressed as an array of strings.
isTemplated()
public function isTemplated(): bool;Returns whether this is a templated link.
Html\Link\LinkProvider
ClassSource on GitHubPhalcon\Html\Link\AbstractLinkProviderPhalcon\Html\Link\LinkProvider- implementsPhalcon\Html\Link\Interfaces\LinkProviderInterface
Uses Phalcon\Contracts\Html\Link\LinkTypes · Phalcon\Html\Link\Interfaces\LinkProviderInterface
Method Summary
publicarraygetLinks()Returns an iterable of LinkInterface objects.
publicarraygetLinksByRel(mixed $rel)Returns an iterable of LinkInterface objects that have a specific
Methods
getLinks()
public function getLinks(): array;Returns an iterable of LinkInterface objects.
The iterable may be an array or any PHP \Traversable object. If no links are available, an empty array or \Traversable MUST be returned.
getLinksByRel()
public function getLinksByRel( mixed $rel ): array;Returns an iterable of LinkInterface objects that have a specific relationship.
The iterable may be an array or any PHP \Traversable object. If no links with that relationship are available, an empty array or \Traversable MUST be returned.
Html\Link\Serializer\Header
ClassSource on GitHubClass Phalcon\Http\Link\Serializer\Header
Phalcon\Html\Link\Serializer\Header- implementsPhalcon\Html\Link\Serializer\SerializerInterface
Uses Phalcon\Contracts\Html\Link\LinkTypes
Method Summary
Methods
serialize()
public function serialize( array $links ): string|null;Serializes all the passed links to a HTTP link header
Html\Link\Serializer\SerializerInterface
InterfaceSource on GitHubClass Phalcon\Http\Link\Serializer\SerializerInterface
Phalcon\Html\Link\Serializer\SerializerInterface
Uses Phalcon\Contracts\Html\Link\LinkTypes
Method Summary
Methods
serialize()
public function serialize( array $links ): string|null;Serializer method
Html\TagFactory
ClassSource on GitHubServiceLocator implementation for Tag helpers.
Built-in services are seeded by the constructor. Users may add or override
services via set(), passing a Closure that returns the helper instance.
Helpers are cached per name after first construction.
__call() resolves the named helper and dispatches to its __invoke(),
so each entry in the @method block below describes the result of calling
$factory->serviceName(...) rather than newInstance("serviceName").
@method string a(string $href, string $text, html_attributes $attributes = [], bool $raw = false) @method string aRaw(string $href, string $text, html_attributes $attributes = []) @method string base(string $href, html_attributes $attributes = []) @method string body(html_attributes $attributes = []) @method Breadcrumbs breadcrumbs(string $indent = ’ ’, string $delimiter = “\n”) @method string button(string $text, html_attributes $attributes = [], bool $raw = false) @method string buttonRaw(string $text, html_attributes $attributes = []) @method string close(string $tag, bool $raw = false) @method Doctype doctype(int $type = Doctype::HTML5, string $delimiter = “\n”) @method string element(string $tag, string $text, html_attributes $attributes = [], bool $raw = false) @method string elementRaw(string $tag, string $text, html_attributes $attributes = []) @method string form(html_attributes $attributes = []) @method string friendlyTitle(string $text, string $separator = ‘-’, bool $lower = true, mixed $replace = null) @method string img(string $src, html_attributes $attributes = []) @method Checkbox inputCheckbox(string $name, string $value = null, html_attributes $attributes = []) @method CheckboxGroup inputCheckboxGroup(string $name, array $options, mixed $checked = null, array $attributes = []) @method Generic inputColor(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputDate(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputDateTime(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputDateTimeLocal(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputEmail(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputFile(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputHidden(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputImage(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputInput(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputMonth(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputNumeric(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputPassword(string $name, string $value = null, html_attributes $attributes = []) @method Radio inputRadio(string $name, string $value = null, html_attributes $attributes = []) @method RadioGroup inputRadioGroup(string $name, array $options, mixed $checked = null, array $attributes = []) @method Generic inputRange(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputSearch(string $name, string $value = null, html_attributes $attributes = []) @method Select inputSelect(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputSubmit(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputTel(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputText(string $name, string $value = null, html_attributes $attributes = []) @method Textarea inputTextarea(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputTime(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputUrl(string $name, string $value = null, html_attributes $attributes = []) @method Generic inputWeek(string $name, string $value = null, html_attributes $attributes = []) @method string label(string $label, html_attributes $attributes = [], bool $raw = false) @method string labelRaw(string $label, html_attributes $attributes = []) @method Link link(string $indent = ’ ’, string $delimiter = “\n”) @method Meta meta(string $indent = ’ ’, string $delimiter = “\n”) @method Ol ol(string $indent = ’ ’, string $delimiter = null, html_attributes $attributes = []) @method Ol olRaw(string $indent = ’ ’, string $delimiter = null, html_attributes $attributes = []) @method string preload(string $href, string $type = ‘style’, html_attributes $attributes = []) @method Script script(string $indent = ’ ’, string $delimiter = “\n”) @method Style style(string $indent = ’ ’, string $delimiter = “\n”) @method string tag(string $name, html_attributes $attributes = []) @method Title title(string $indent = ’ ’, string $delimiter = “\n”) @method Ul ul(string $indent = ’ ’, string $delimiter = null, html_attributes $attributes = []) @method Ul ulRaw(string $indent = ’ ’, string $delimiter = null, html_attributes $attributes = []) @method string voidTag(string $name, html_attributes $attributes = [])
Phalcon\Html\TagFactory
Uses Closure · Phalcon\Contracts\Html\HtmlTypes · Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Exceptions\ServiceNotRegistered · Phalcon\Html\Helper\Anchor · Phalcon\Html\Helper\Base · Phalcon\Html\Helper\Body · Phalcon\Html\Helper\Breadcrumbs · Phalcon\Html\Helper\Button · Phalcon\Html\Helper\Close · Phalcon\Html\Helper\Doctype · Phalcon\Html\Helper\Element · Phalcon\Html\Helper\Form · Phalcon\Html\Helper\FriendlyTitle · Phalcon\Html\Helper\Img · Phalcon\Html\Helper\Input\Checkbox · Phalcon\Html\Helper\Input\CheckboxGroup · Phalcon\Html\Helper\Input\Generic · Phalcon\Html\Helper\Input\Radio · Phalcon\Html\Helper\Input\RadioGroup · Phalcon\Html\Helper\Input\Select · Phalcon\Html\Helper\Input\Textarea · Phalcon\Html\Helper\Label · Phalcon\Html\Helper\Link · Phalcon\Html\Helper\Meta · Phalcon\Html\Helper\Ol · Phalcon\Html\Helper\Preload · Phalcon\Html\Helper\Script · Phalcon\Html\Helper\Style · Phalcon\Html\Helper\Tag · Phalcon\Html\Helper\Title · Phalcon\Html\Helper\Ul · Phalcon\Html\Helper\VoidTag · Phalcon\Http\ResponseInterface · Phalcon\Mvc\Url\UrlInterface
Method Summary
public__call(string $name,array $arguments)Magic call to make the helper objects available as methods.
public__construct(EscaperInterface $escaper,array $services = [],ResponseInterface|null $response = null,UrlInterface|null $url = null)TagFactory constructor.
publicboolhas(string $name)publicobjectnewInstance(string $name)Create or return a cached instance of the helper.
publicvoidset(string $name,Closure $definition)Register a helper via a zero-argument Closure. The Closure is invoked on
protectedarraygetDefaultServices()Default service recipes. Every entry is a callable that returns a
Properties
protectedarray$factories = []protectedarray$instances = []Methods
__call()
public function __call(
string $name,
array $arguments
);Magic call to make the helper objects available as methods.
__construct()
public function __construct(
EscaperInterface $escaper,
array $services = [],
ResponseInterface|null $response = null,
UrlInterface|null $url = null
);TagFactory constructor.
$services maps a service name to a zero-arg Closure that returns the
helper instance.
has()
public function has( string $name ): bool;newInstance()
public function newInstance( string $name ): object;Create or return a cached instance of the helper.
set()
public function set(
string $name,
Closure $definition
): void;Register a helper via a zero-argument Closure. The Closure is invoked on
the first matching newInstance() call and its return value is cached.
Passing a new definition clears any cached instance so the next call to
newInstance() rebuilds it.
getDefaultServices()
protected function getDefaultServices(): array;Default service recipes. Every entry is a callable that returns a fully-constructed helper instance. Services are built lazily and cached.