Conversation
This was referenced May 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello!
TagFactoryhelpers #16971In raising this pull request, I confirm the following:
Changed
Phalcon\Html\Escaperinto a façade over five per-context escapers (Phalcon\Html\Escaper\HtmlEscaper,AttributeEscaper,CssEscaper,JsEscaper,UrlEscaper); each is reachable viagetXxxEscaper()/setXxxEscaper()so individual contexts can be swapped without subclassing the façade. The legacysetEncoding(),setFlags(), andsetDoubleEncode()setters fan out to all sub-escapers so existing code keeps workingChanged
Phalcon\Html\Helper\AbstractSeries::__toString()toksort()itsstorebefore rendering so entries are emitted in position order rather than registration order;Phalcon\Html\Helper\Style::add()andPhalcon\Html\Helper\Script::add()now accept an optionalint $pos = -1argument that is routed through the new protectedpushOrPlace()helper (negative pushes onto the next auto-increment slot, non-negative places at that key, advancing past occupied slots)Changed
Phalcon\Html\Helper\Input\CheckboxandPhalcon\Html\Helper\Input\Radioto extend a new sharedPhalcon\Html\Helper\Input\AbstractChecked;Radiono longer extendsCheckbox. Two paths now renderchecked="checked": the unconditional opt-ins["checked" => "checked"](case-insensitive) and["checked" => true], and a value-match path comparing the suppliedcheckedattribute against the input'svalue(==by default for mixed int/string round-tripping,===understrict(true))Changed
Phalcon\Html\Helper\Input\CheckboxandPhalcon\Html\Helper\Input\Radioto extend a new sharedPhalcon\Html\Helper\Input\AbstractChecked;Radiono longer extendsCheckbox. Thechecked/valuecomparison is loose (==) by default so mixed int/string form input round-trips correctly, withstrict(true)available to opt back into===matchingChanged
Phalcon\Html\TagFactoryto no longer extendPhalcon\Factory\AbstractFactory; the registration pipeline now accepts class-strings, closures/callables, or[className, [depKey, ...]]/[className, [depKey, ...], [extraArg, ...]]tuples, and helpers are lazily cached per name in a separateinstancesmap soset()overrides correctly invalidate the previous instance.has()now reports against the recipe map instead of the resolved-instance mapAdded
Phalcon\Html\Escaper\AbstractEscaper,Phalcon\Html\Escaper\AttributeEscaper,Phalcon\Html\Escaper\CssEscaper,Phalcon\Html\Escaper\HtmlEscaper,Phalcon\Html\Escaper\JsEscaper, andPhalcon\Html\Escaper\UrlEscaperas the per-context building blocks behindPhalcon\Html\EscaperAdded
Phalcon\Html\Helper\Input\GenericandPhalcon\Html\Helper\Input\AbstractChecked;Genericaccepts the HTML5typevia the constructor (withsetType()to change it after construction), lettingTagFactoryregister a single class for all type-string-only inputs and differentiate them through the recipe mapAdded
Phalcon\Html\Helper\Input\Select::placeholder(string $text)to inject a<option value="" disabled selected>$text</option>first entry, andPhalcon\Html\Helper\Input\Select::strict(bool $flag = true)to opt the option/selectedcomparison from the new loose default into strict (===) matchingPhalcon\Html\Helper\Script::beginInternal()andendInternal(array $attributes = [], int $pos = -1)to capture inline JavaScript via output buffering and append it to the asset stack as a<script>...</script>blockAdded
Phalcon\Html\Helper\Tag(open tag) andPhalcon\Html\Helper\VoidTag(self-closing tag) as escape hatches for arbitrary tag names without a dedicated helper; available viaTagFactoryastagandvoidTagAdded
Rawfactory variantsaRaw,buttonRaw,elementRaw,labelRaw,olRaw, andulRawtoPhalcon\Html\TagFactory, each backed by a tuple recipe that pinsraw = trueon the constructor of the underlying helperRemoved the per-type input helpers
Phalcon\Html\Helper\Input\Color,Date,DateTime,DateTimeLocal,Email,File,Hidden,Image,Input,Month,Numeric,Password,Range,Search,Submit,Tel,Text,Time,Url, andWeek; theirTagFactoryservice names (inputColor,inputDate, ...) now resolve toPhalcon\Html\Helper\Input\Genericwith the appropriatetypebaked into the recipe, so callers using the factory keep working unchangedThanks