mj-zana / view-twig
Twig templates for mj-zana/view
v2.41.0
2026-11-21 13:07 UTC
Requires
- php: ^8.5
- mj-zana/view: ^2.4
- twig/twig: ^3.14
Requires (Dev)
- mj-zana/translation: ^2.1
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v2.41.0
- v2.40.0
- v2.39.0
- v2.38.0
- v2.37.0
- v2.36.0
- v2.35.0
- v2.34.0
- v2.33.0
- v2.32.0
- v2.31.0
- v2.30.0
- v2.29.0
- v2.28.0
- v2.27.0
- v2.26.0
- v2.25.0
- v2.24.0
- v2.23.0
- v2.22.0
- v2.21.0
- v2.20.0
- v2.19.0
- v2.18.0
- v2.17.0
- v2.16.0
- v2.15.0
- v2.14.0
- v2.13.0
- v2.12.0
- v2.11.0
- v2.10.0
- v2.9.0
- v2.8.0
- v2.7.0
- v2.6.0
- v2.5.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
This package is auto-updated.
Last update: 2026-12-03 08:38:16 UTC
README
Twig templates for mj-zana/view.
composer require mj-zana/view-twig
Register TwigServiceProvider together with ViewServiceProvider. Templates
then end in .html.twig, in the same folders: templates/ and each module's
Resources/views/, under the module's name.
{% extends 'layouts/site' %}
{% block content %}
<h1>{{ heading }}</h1>
<a href="{{ url('contact') }}">{{ 'nav.contact'|t }}</a>
<form method="post">{{ csrf_field('contact') }}</form>
{% endblock %}
- Names: the extension is optional:
View::make('pages/about'),{% include '@Contact/form' %}. - Escaping: autoescape is
html.Markupvalues and safe helpers such ascsrf_field()are not escaped. - Helpers: every view helper is a Twig function, and
tis also a filter. - Cache: in production, compiled templates are cached in
view.cache(defaultvar/cache/twig), signed whensecurity.secretis set (2.35). Elsewhere, templates recompile when they change. - Twig extensions: add them in a provider's
boot()throughTwig\Environment.
License
MIT