tadcka/smart-twig

Tadcka smart twig library

v0.1.0 2016-04-02 05:20 UTC

This package is not auto-updated.

Last update: 2024-11-15 20:16:26 UTC


README

Build Status

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.