Skip to content

[6.x] Adds Component Tag Syntax Support to Antlers #11799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JohnathonKoster
Copy link
Contributor

@JohnathonKoster JohnathonKoster commented May 18, 2025

This PR adds Antlers Component Tag syntax support to Antlers, allowing for templates like:

<s:collection:pages>
    {{ title }}
</s:collection:pages>

With params:

<s:collection:pages as="pages">
    {{ pages }}
        {{ title }}
    {{ /pages }}
</s:collection:pages>

This syntax is similar to what is already supported by the Blade integration, with the exception that parameters/attributes dynamic variables, syntax, etc. follows the Antlers rules instead of Blade's. Docs PR to come! :)

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work when you use it in a standard template. (When RuntimeParser@parseView is used.)

It works great when templates are manually parsed (RuntimeParser@parse) like in partial slots, or whever Antlers::parse() is used.

This method ultimately gets called by the others
@JohnathonKoster
Copy link
Contributor Author

Fixed up w/ tests! Good catch, and was a pretty dumb one for me to miss! 🤦‍♂️

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