Skip to content

NeoForms helper functions, rendered through the template - #36

Merged
riki137 merged 3 commits into
masterfrom
riki137/static-html-template
Oct 16, 2026
Merged

riki137 merged 3 commits into
masterfrom
riki137/static-html-template

Conversation

@riki137

@riki137 riki137 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Continues #35 (his commits are kept as they are).

Headings, paragraphs, alerts, spaces, separators and raw html no longer build their markup in the form builder. The builder only stores what the element is (kind, text, level/type/size) and the markup comes from the new NeoFormTemplate::staticHtml(), so a custom template can restyle them. {formRow} attrs apply to them too.

  1. new optional last $name argument on all of them, so they can be placed with {formRow $form['x']}. Default names are _static1, _static2, ... instead of uniqid()
  2. text is translated when rendered
  3. $attrs arguments removed, use setHtmlAttribute() or {formRow} attrs
  4. addLineBreak() removed, addSpace('sm') does the job
  5. addSpace() takes sm, md, lg or any CSS length

Added tests/Control/StaticHtmlTest.php.

@riki137
riki137 merged commit 77612b4 into master Oct 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants