tadcka/smart-twig

Tadcka smart twig library

Installs: 4 619

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 1

pkg:composer/tadcka/smart-twig

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

This package is not auto-updated.

Last update: 2025-10-04 00:35:23 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.