You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was merged into the main branch.
Discussion
----------
[Twig] Add reprise_entry_exists()
| Q | A
| -------------- | ---
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Documentation? | yes
| License | MIT
Adds a `reprise_entry_exists('name')` Twig function that returns a bool, the direct counterpart of Encore's `encore_entry_exists`. It lets templates guard page-specific or optional entries so that rendering their tags doesn't throw in strict mode when the entry isn't present in `entrypoints.json`:
```twig
{% if reprise_entry_exists('checkout') %}
{{ reprise_entry_script_tags('checkout') }}
{% endif %}
```
The function delegates to the existing lookup's `entryExists()` method, so there's no new lookup path. Documented in `doc/index.rst` alongside the existing tag functions, with unit tests and Twig-level tests.
Commits
-------
bd6612c [Twig] Add reprise_entry_exists()
0 commit comments