Skip to content

Optional Model-View Engine#45

Merged
capachow merged 6 commits intodevelopfrom
feature/views
Apr 10, 2026
Merged

Optional Model-View Engine#45
capachow merged 6 commits intodevelopfrom
feature/views

Conversation

@capachow
Copy link
Copy Markdown
Owner

@capachow capachow commented Apr 10, 2026

  • Added a built-in Regex-powered Model-View Engine in ~40 lines of code (increasing total framework size to 14kb).
  • Enabled auto-escaped variable output via shorthand (:) and implicit (:=) attributes to protect against XSS by default.
  • Added support for PHP control structures using HTML-style tags (<if>, <elseif>, <else>, <foreach>, <break>, <continue>).
  • Whitelisted core Arcane helpers (php, scribe, relay, path, env) for safe, raw HTML execution in templates.
  • Implemented template partials via the tag and added support for stripped <-- developer comments -->.
  • Refactored engine syntax to strictly match the new modern PHP spacing standards (if (), elseif ()) established on develop.
  • Added comprehensive documentation (Section 5) to the README.md explaining the "Golden Rule" of the syntax and providing clear examples.
  • Clarified the current in-memory execution (eval()) and set expectations for future file-caching performance updates.

@capachow capachow changed the title Feature/views Optional Model-View Engine Apr 10, 2026
* Defined VIEWFILE constant outside of the relay closure to prevent overwriting user-defined $view or $html helpers.
* Nested the preg_replace compilation directly into the eval() string to avoid creating any temporary scope variables.
* Updated README.md to clarify VIEWFILE points to the raw, uncompiled .html template file.
* Updated 'uncompiled' to 'resolved' to perfectly match the terminology used for PAGEFILE and LAYOUTFILE.
@capachow capachow merged commit 874cb42 into develop Apr 10, 2026
@capachow capachow deleted the feature/views branch April 10, 2026 09:26
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.

1 participant