Download the PHP package kylekatarnls/jade-symfony without Composer
On this page you can find all versions of the php package kylekatarnls/jade-symfony. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kylekatarnls/jade-symfony
More information about kylekatarnls/jade-symfony
Files in kylekatarnls/jade-symfony
Package jade-symfony
Short Description Pug template engine for Symfony
License MIT
Informations about the package jade-symfony
This repository now lives on https://github.com/pug-php/pug-symfony
Pug-Symfony
Pug template engine for Symfony
Install
In the root directory of your Symfony project, open a terminal and enter:
When your are asked to install automatically needed settings, enter yes ; or if you prefer, follow the manual installation steps below.
Manual alternative steps
Add pug in the templating.engines setting in app/config/config.yml by merging the following to your settings:
In order to use pug cli commands, you will also need to add
Pug\PugSymfonyBundle\PugSymfonyBundle()
to your AppKenel.php.
Configure
You can set pug options by accessing the container (from controller or from the kernel) in Symfony.
See the options in the pug-php README: https://github.com/pug-php/pug And methods directly available on the service: https://github.com/pug-php/pug-symfony/blob/master/src/Jade/JadeSymfonyEngine.php
Initial options can also be passed in parameters in your config.yml:
Usage
Create jade views by creating files with .pug extension in app/Resources/views such as contact.pug with some Jade like this:
Then call it in your controller:
Deployment
In production, you better have to pre-render all your templates to improve performances. To do that, you have to add Pug\PugSymfonyBundle\PugSymfonyBundle in your registered bundles.
In app/AppKernel.php, in the method, add the Pug bundle (this has been done automatically if you installed pug-symfony 2.3 or above with automated script):
This will make the command available, now each time you deploy your app, enter the command below:
All versions of jade-symfony with dependencies
pug/installer Version ^0.1.0
pug-php/pug Version ^2.7.1 || ^3.0.0@beta
pug-php/pug-assets Version ^1.0.1
symfony/symfony Version ^2.7 || ^3.0 || ^4.0