Skip to content

T16894 html helpers#16895

Merged
niden merged 7 commits intophalcon:5.0.xfrom
niden-code:T16892-html-helpers
Apr 18, 2026
Merged

T16894 html helpers#16895
niden merged 7 commits intophalcon:5.0.xfrom
niden-code:T16892-html-helpers

Conversation

@niden
Copy link
Copy Markdown
Member

@niden niden commented Apr 17, 2026

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I have updated the relevant CHANGELOG
  • I have created a PR for the documentation about this change

Replaces the deprecated Phalcon\Tag\Select usage in Forms\Element\Select::render() with the TagFactory-based Html\Helper\Input\Select helper.

Changes:

  • Introduces a SelectDataInterface with two concrete implementations - ArrayData (wraps a plain PHP array) and ResultsetData (wraps a ResultsetInterface with a two-column using map) - keeping ORM concerns out of the HTML helper.
  • Adds Html\Helper\Input\Select::fromData() which iterates the data provider and delegates to existing add() / optGroup() methods, with full optgroup support for nested arrays.
  • Rewrites Forms\Element\Select::render() to use the new helper, preserving all existing behavior: selected value, useEmpty/emptyValue/emptyText, using for resultsets, id/name attribute handling, and bracket-name detection.
  • Moves exception messages out of throw sites into named static factory methods on Forms\Exception (usingParameterRequired, tagFactoryNotFound).
  • Removes the silent last-resort DI fallback in AbstractElement::getLocalTagFactory() that constructed a fresh TagFactory from scratch; an explicit exception is now thrown when neither setTagFactory() nor the parent Form provides one, with a null guard for environments where no DI container is registered.

@niden niden requested a review from Jeckerson April 17, 2026 22:39
@niden niden self-assigned this Apr 17, 2026
@niden niden added enhancement Enhancement to the framework 5.0 The issues we want to solve in the 5.0 release labels Apr 17, 2026
@niden niden changed the base branch from master to 5.0.x April 17, 2026 22:39
@niden niden merged commit 8fddcdd into phalcon:5.0.x Apr 18, 2026
61 checks passed
@niden niden deleted the T16892-html-helpers branch April 18, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.0 The issues we want to solve in the 5.0 release enhancement Enhancement to the framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants