nickyeoman/nytwig

Twig template scaffolding

1.0.8 2024-03-02 03:51 UTC

This package is auto-updated.

Last update: 2024-03-02 03:53:15 UTC


README

This is the scaffolding Nick uses for his web projects.
It is based, but heavly modifed, on html5boilerplate.

Installation

You will have to configure your application to include the vendor directory and asssign the namespace "nytwig" (required)

How To Twig

$loader->addPath('vendor/nickyeoman/nytwig/src', 'nytwig');

How To Symfony

Open the file config/packages/twig.yaml and add (under "default_path"):

paths:
    '%kernel.project_dir%/vendor/nickyeoman/nytwig/src': 'nytwig'

Use

{% extends '@nytwig/master.html.twig' %}

{% block body %}
<p>Content Here</p>
{% endblock %}

Overrides

In your view directly create a folder named 'cms' and create the file you want to override there with the same name.