tadcka / smart-twig
Tadcka smart twig library
Installs: 4 618
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: >=5.4
- twig/twig: ~1.23|~2.0
Requires (Dev)
- phpunit/phpunit: ~4.2
This package is not auto-updated.
Last update: 2024-11-15 20:16:26 UTC
README
Installation
Install via Composer
composer require tadcka/smart-twig "dev-master"
Templates Hinting
SmartTwig allows to enable templates hinting and in such a way helps to frontend developer to find proper template. This option can be enabled in application configuration with redefining base template class for twig (example for Symfony application):
twig: base_template_class: Tadcka\SmartTwig\Template
As a result of such change user can find HTML comments on the page
<!-- Start Template: template_name.html.twig --> ... <!-- End Template: template_name.html.twig -->
or see "template_name" variable for AJAX requests that expecting JSON
"template_name":"template_name.html.twig"
The templates hinting is enabled by default in development mode.