cyril-verloop/symfony-twig-templates

A base Twig template for Symfony.

Fund package maintenance!
cyrilverloop

Installs: 785

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:Twig

2.1.1 2023-12-11 15:55 UTC

This package is auto-updated.

Last update: 2024-08-30 14:10:39 UTC


README

Twig templates for Symfony 7+.

For compatibility with Symfony <7.0, see version <2.0 of this software.

License

Installation

As a Composer depedency

In your project directory run

user@host project$ composer require "cyril-verloop/symfony-twig-templates"

For development purposes

user@host ~$ cd [PATH_WHERE_TO_PUT_THE_PROJECT] # E.g. ~/projects/
user@host projects$ git clone https://github.com/cyrilverloop/symfony-twig-templates.git
user@host projects$ cd symfony-twig-templates

Usage

The templates just needs to be referenced in the config/packages/twig.yaml file :

twig:
    paths:
        '%kernel.project_dir%/vendor/cyril-verloop/symfony-twig-templates/templates': CVSymfonyTwigTemplates

You can also look at the config/packages/twig.yaml file of this project.

Then, you can inherit the templates :

{% extends "@CVSymfonyTwigTemplates/base.html.twig" %}
{# or #}
{% extends "@CVSymfonyTwigTemplates/layout.html.twig" %}

{# Your code here #}

The documentation of each template can be found in resources/documentations/ :