Templates for Symfony 7+.
In your project directory run
user@host project$ composer require "cyril-verloop/templates-bundle"
user@host ~$ cd [PATH_WHERE_TO_PUT_THE_PROJECT] # E.g. ~/projects/
user@host projects$ git clone https://github.com/cyrilverloop/templates-bundle.git
user@host projects$ cd templates-bundle
With Symfony Flex, you do not need to add the configuration.
Without Symfony Flex, the templates needs to be referenced in the config/packages/twig.yaml file :
twig:
paths:
'%kernel.project_dir%/vendor/cyril-verloop/templates-bundle/templates': CVTemplatesBundle
You can also look at the config/packages/twig.yaml file of this project.
Then, you can inherit the templates :
{% extends "@CVTemplatesBundle/base.html.twig" %}
{# or #}
{% extends "@CVTemplatesBundle/layout.html.twig" %}
{# Your code here #}
You can find detailed informations in the documentation.
How can I help you explore Laravel packages today?