Skip to content

Symfony 2 and 3 manual installation

Kyle edited this page Jul 5, 2018 · 1 revision

To use Pug as a template engine in Symfony 4, you need to follow those steps:

app/config/config.yml

Add the templating.engine.pug service and pug in the engines setting:

services:
    templating.engine.pug:
        class: Pug\PugSymfonyEngine
        arguments: ["@kernel"]

framework:
    templating:
        engines: ['pug', 'twig', 'php']

app/AppKenel.php

In order to use pug cli commands, you will also need to add Pug\PugSymfonyBundle\PugSymfonyBundle to your app/AppKenel.php.

    new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
    new Pug\PugSymfonyBundle\PugSymfonyBundle(),
    // ... other bundles
Clone this wiki locally