nickyeoman/nytwig

Twig template scaffolding

1.0.10 2024-04-17 21:33 UTC

This package is auto-updated.

Last update: 2024-04-17 22:18:52 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.