Html\Attributes
ClassSource on GitHubThis class helps to work with HTML Attributes
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 methodpublicstringrender()Render attributes as HTML attributesprotectedstringrenderAttributes( array$attributes )@todo remove this when we refactor forms. Maybe remove this class? Put it into traitsMethods
__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 AttributespublicAttributesInterfacesetAttributes( Attributes$attributes )Set AttributesMethods
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
Method Summary
publicstaticadd(string$label,string$link = "")Adds a new crumb.publicvoidclear()Clears the crumbspublicstringgetSeparator()Crumb separatorpublicvoidremove( string$link )Removes crumb by url.publicstringrender()Renders and outputs breadcrumbs based on previously set template.publicstaticsetSeparator( string$separator )Set the separatorpublicarraytoArray()Returns the internal breadcrumbs arrayMethods
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;Crumb 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\3E@property AttributeEscaper $attributeEscaper @property CssEscaper $cssEscaper @property HtmlEscaper $htmlEscaper @property JsEscaper $jsEscaper @property UrlEscaper $urlEscaper
Phalcon\Html\Escaper- implementsPhalcon\Html\Escaper\EscaperInterface
Uses 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 compatibilitypublicstringattributes( mixed$input = null )Escapes a HTML attribute string or array. Delegates to the configuredpublicstringcss( string$input )Escape CSS strings. Delegates to the configured 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 the configured HtmlEscaper.publicstringjs( string$input )Escape javascript strings. Delegates to the configured 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-objects.publicstaticsetEncoding( string$encoding )Sets the encoding. Fans out to all sub-objects.publicstaticsetFlags( int$flags )Sets the htmlspecialchars flags. Fans out to all sub-objects.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 the configured 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 the configured
AttributeEscaper.
css()
public function css( string $input ): string;Escape CSS strings. Delegates to the configured 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 the configured HtmlEscaper.
js()
public function js( string $input ): string;Escape javascript strings. Delegates to the configured 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-objects.
setEncoding()
public function setEncoding( string $encoding ): static;Sets the encoding. Fans out to all sub-objects.
setFlags()
public function setFlags( int $flags ): static;Sets the htmlspecialchars flags. Fans out to all sub-objects.
setHtmlEscaper()
public function setHtmlEscaper( HtmlEscaper $escaper ): static;setHtmlQuoteType()
public function setHtmlQuoteType( int $flags ): static;Sets the HTML quoting type for htmlspecialchars.
$escaper->setHtmlQuoteType(ENT_XHTML);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 the configured 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
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 theirpublicstringgetEncoding()Returns the internal encoding used by the escaperpublicstringhtml( string$input )Escapes a HTML string.publicstringjs( string$input )Escape Javascript strings by replacing non-alphanumeric chars by theirpublicEscaperInterfacesetEncoding( string$encoding )Sets the encoding to be used by the escaperpublicEscaperInterfacesetFlags( int$flags )Sets the HTML quoting type for htmlspecialcharspublicstringurl( string$input )Escapes a URL. Internally uses rawurlencodeMethods
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).
@property bool $doubleEncode @property string $encoding @property int $flags
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 forpublicboolgetDoubleEncode()publicstringgetEncoding()publicintgetFlags()publicstringnormalizeEncoding( string$input )Normalizes a string's encoding to UTF-32, used by the CSS and JSpublicstaticsetDoubleEncode( bool$doubleEncode )publicstaticsetEncoding( string$encoding )publicstaticsetFlags( int$flags )Properties
protectedbool$doubleEncode = trueprotectedstring$encoding = "utf-8"protectedint$flags = 11ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401Methods
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 GitHubPhalcon\Html\Exception
Exceptions thrown in Phalcon\Html will use this class
\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 GitHub@property string $delimiter @property EscaperInterface $escaper @property string $indent @property int $indentLevel
Phalcon\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\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 tagprotectedstringindent()Replicates the indent x times as per indentLevelprotectedarrayinjectAttribute(string$key,string$value,array$attributes)Forces a single key into the attribute array, stripping any user-suppliedprotectedarrayorderAttributes(array$overrides,array$attributes)Keeps all the attributes sorted - same order all the timeprotectedstringrenderArrayElements(array$elements,string$delimiter)Traverses an array and calls the method defined in the first elementprotectedstringrenderAttributes( array$attributes )Renders all the attributesprotectedstringrenderElement(string$tag,array$attributes = [])Renders an elementprotectedstringrenderFullElement(string$tag,string$text,array$attributes = [],bool$raw = false)Renders an elementprotectedstringrenderTag(string$tag,array$attributes = [],string$close = "")Renders a tagprotectedstringselfClose(string$tag,array$attributes = [])Produces a self close tag i.e. <img />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
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 a single key into the attribute array, stripping any user-supplied
value for that key first. Used by helpers whose first positional argument
is itself an attribute (href for Anchor, src for Img, etc.) to make
sure that argument always wins.
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\Html\Exception
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 GitHub@property array $attributes @property array $store
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractSeries
Method Summary
publicstatic__invoke(string$indent = " ",string|null$delimiter = null)public__toString()Generates and returns the HTML for the list. Entries are sorted bypublicstaticreset()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 integerProperties
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 position is negative the entry is pushed onto the next
available auto-increment slot. When position 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
@property bool $forceRaw
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Anchor
Uses Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Exception
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> tagProperties
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\Html\Exception
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\Html\Exception
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\Html\Escaper\EscaperInterface · Phalcon\Mvc\Url\UrlInterface · Phalcon\Support\Helper\Str\Interpolate
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
@property bool $forceRaw
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Button
Uses Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Exception
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> tagpublicstring__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
@property bool $forceRaw
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Element
Uses Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Exception
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\Html\Exception
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 Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Exception · 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\Html\Exception
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).
@property array $label @property bool $strict
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Input\AbstractInputPhalcon\Html\Helper\Input\AbstractChecked
Uses Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Helper\Doctype
Method Summary
public__construct(EscaperInterface$escaper,Doctype|null$doctype = null)public__toString()Returns the HTML for the input, optionally surrounded by the labelpublicstaticlabel( array$attributes = [] )Attaches a wrapping <label> to the element. The supplied attributespublicstaticstrict( bool$flag = true )Toggles strict (===) comparison between the checked attribute andprotectedvoidprocessChecked()Decides whether the rendered tag carries checked="checked". TwoprotectedstringprocessUnchecked()Returns the markup for the optional hidden companion input that letsProperties
protectedarray$label = []protectedbool$strict = falseMethods
__construct()
public function __construct(
EscaperInterface $escaper,
Doctype|null $doctype = null
);__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\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
@property array $attributes @property string $type @property string $value
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Input\AbstractInput
Uses 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 elementProperties
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\Html\Helper\AbstractList
Method Summary
publicstaticadd(string$text,string|null$value = null,array$attributes = [],bool$raw = false)Add an element to the listpublicstaticaddPlaceholder(string$text,string|null$value = null,array$attributes = [],bool$raw = false)Add a placeholder to the elementpublicstaticfromData( SelectData$data )Populates the select from a data provider.publicstaticoptGroup(string|null$label = null,array$attributes = [])Creates an option grouppublicstaticplaceholder( string$text )Adds a non-selectable placeholder option as the first entry. Renderspublicstaticselected( string$selected )publicstaticstrict( bool$flag = true )Toggles strict (===) comparison between an option's value andprotectedstringgetTag()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
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 InvalidArgumentException · Phalcon\Contracts\Html\Helper\Input\SelectData · 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 (viaprotectedvoidresolve()Walks the resultset once, building both the option map and theProperties
protectedarray$attributesMap = []protectedarray|null$resolvedAttributes = nullprotectedarray|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 present) 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
@property bool $forceRaw
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\Label
Uses Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\Exception
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
Method Summary
publicstaticadd(string$url,array$attributes = [],int$position = -1)Add an element to the listprotectedarraygetAttributes(string$url,array$attributes)Returns the necessary attributesprotectedstringgetTag()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\Html\Exception
Method Summary
publicstaticadd(array$attributes = [],int$position = -1)Add an element to the listpublicstaticaddHttp(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
@property bool $forceRaw
Phalcon\Html\Helper\AbstractHelperPhalcon\Html\Helper\AbstractListPhalcon\Html\Helper\Ol
Uses 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 listprotectedstringgetTag()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\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\Html\Exception
Method Summary
publicstaticadd(string$url,array$attributes = [],int$position = -1)Add an element to the listpublicvoidbeginInternal()Begins capturing inline script content via output buffering. PairpublicstaticendInternal(array$attributes = [],int$position = -1)Closes an inline-script buffer opened by beginInternal() and addsprotectedarraygetAttributes(string$url,array$attributes)Returns the necessary attributesprotectedstringgetTag()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\Html\Exception
Method Summary
publicstaticadd(string$url,array$attributes = [],int$position = -1)Add an element to the listpublicstaticsetStyle( bool$flag )Sets if this is a style or link tagprotectedarraygetAttributes(string$url,array$attributes)Returns the necessary attributesprotectedstringgetTag()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\Html\Exception
Method Summary
Methods
__invoke()
public function __invoke(
string $name,
array $attributes = []
): string;Html\Helper\Title
ClassSource on GitHubClass Title
@property array $append @property string $delimiter @property string $indent @property array $prepend @property string $title @property string $separator
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 backpublic__toString()Returns the title tagspublicstaticappend(string$text,bool$raw = false)Appends text to current document titlepublicstringget()Returns the titlepublicstaticprepend(string$text,bool$raw = false)Prepends text to current document titlepublicstaticset(string$text,bool$raw = false)Sets the titlepublicstaticsetSeparator(string$separator,bool$raw = false)Sets the separatorProperties
protectedarray$append = []protectedarray$prepend = []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\Html\Exception
Method Summary
Methods
__invoke()
public function __invoke(
string $name,
array $attributes = []
): string;Html\Link\AbstractLink
AbstractSource on GitHub@property Collection $attributes @property string $href @property Collection $rels @property bool $templated
Phalcon\Html\Link\AbstractLink
Uses 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.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.
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.
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 GitHub@property array $links
Phalcon\Html\Link\AbstractLinkProvider
Uses 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 specificprotectedstaticdoWithLink( 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 keyProperties
protectedarray$links = []Methods
__construct()
public function __construct( array $links = [] );LinkProvider constructor.
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\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
@property LinkInterface[] $links
Phalcon\Html\Link\AbstractLinkProviderPhalcon\Html\Link\LinkProviderPhalcon\Html\Link\EvolvableLinkProvider- implementsPhalcon\Html\Link\Interfaces\EvolvableLinkProviderInterface
Uses 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
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.
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
Method Summary
publicarraygetLinks()Returns an array of LinkInterface objects.publicarraygetLinksByRel( string$rel )Returns an array of LinkInterface objects that have a specificMethods
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\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 or not this is a templated link.Methods
getAttributes()
public function getAttributes(): array;Returns a list of attributes that describe the target URI.
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 or not this is a templated link.
Html\Link\LinkProvider
ClassSource on GitHub@property LinkInterface[] links
Phalcon\Html\Link\AbstractLinkProviderPhalcon\Html\Link\LinkProvider- implementsPhalcon\Html\Link\Interfaces\LinkProviderInterface
Uses Phalcon\Html\Link\Interfaces\LinkInterface · 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 specificMethods
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
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
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.
@method string a(string $href, string $text, array $attributes = [], bool $raw = false) @method string aRaw(string $href, string $text, array $attributes = []) @method string base(string $href, array $attributes = []) @method string body(array $attributes = []) @method Breadcrumbs breadcrumbs(string $indent = ’ ’, string $delimiter = “\n”) @method string button(string $text, array $attributes = [], bool $raw = false) @method string buttonRaw(string $text, array $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, array $attributes = [], bool $raw = false) @method string elementRaw(string $tag, string $text, array $attributes = []) @method string form(array $attributes = []) @method string friendlyTitle(string $text, string $separator = ‘-’, bool $lowercase = true, mixed $replace = null) @method string img(string $src, array $attributes = []) @method Checkbox inputCheckbox(string $name, string $value = null, array $attributes = []) @method CheckboxGroup inputCheckboxGroup(string $name, array $options, mixed $checked = null, array $attributes = []) @method Generic inputColor(string $name, string $value = null, array $attributes = []) @method Generic inputDate(string $name, string $value = null, array $attributes = []) @method Generic inputDateTime(string $name, string $value = null, array $attributes = []) @method Generic inputDateTimeLocal(string $name, string $value = null, array $attributes = []) @method Generic inputEmail(string $name, string $value = null, array $attributes = []) @method Generic inputFile(string $name, string $value = null, array $attributes = []) @method Generic inputHidden(string $name, string $value = null, array $attributes = []) @method Generic inputImage(string $name, string $value = null, array $attributes = []) @method Generic inputInput(string $name, string $value = null, array $attributes = []) @method Generic inputMonth(string $name, string $value = null, array $attributes = []) @method Generic inputNumeric(string $name, string $value = null, array $attributes = []) @method Generic inputPassword(string $name, string $value = null, array $attributes = []) @method Radio inputRadio(string $name, string $value = null, array $attributes = []) @method RadioGroup inputRadioGroup(string $name, array $options, mixed $checked = null, array $attributes = []) @method Generic inputRange(string $name, string $value = null, array $attributes = []) @method Generic inputSearch(string $name, string $value = null, array $attributes = []) @method Select inputSelect(string $name, string $value = null, array $attributes = []) @method Generic inputSubmit(string $name, string $value = null, array $attributes = []) @method Generic inputTel(string $name, string $value = null, array $attributes = []) @method Generic inputText(string $name, string $value = null, array $attributes = []) @method Textarea inputTextarea(string $name, string $value = null, array $attributes = []) @method Generic inputTime(string $name, string $value = null, array $attributes = []) @method Generic inputUrl(string $name, string $value = null, array $attributes = []) @method Generic inputWeek(string $name, string $value = null, array $attributes = []) @method string label(string $label, array $attributes = [], bool $raw = false) @method string labelRaw(string $label, array $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, array $attributes = []) @method Ol olRaw(string $indent = ’ ’, string $delimiter = null, array $attributes = []) @method string preload(string $href, string $type = ‘style’, array $attributes = []) @method Script script(string $indent = ’ ’, string $delimiter = “\n”) @method Style style(string $indent = ’ ’, string $delimiter = “\n”) @method string tag(string $name, array $attributes = []) @method Title title(string $indent = ’ ’, string $delimiter = “\n”) @method Ul ul(string $indent = ’ ’, string $delimiter = null, array $attributes = []) @method Ul ulRaw(string $indent = ’ ’, string $delimiter = null, array $attributes = []) @method string voidTag(string $name, array $attributes = [])
Phalcon\Html\TagFactory
Uses Closure · 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 onprotectedarraygetDefaultServices()Default service recipes. Every entry is a Closure that returns aProperties
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.
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 Closure that returns a fully-constructed helper instance. Services are built lazily and cached.