1. Go to this page and download the library: Download kylekatarnls/jade-symfony library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kylekatarnls / jade-symfony example snippets
$services = $kernel->getContainer();
$pug = $services->get('templating.engine.pug');
$pug->setOptions(array(
'pretty' => true,
'pugjs' => true,
// ...
));
// You can get the Pug engine to call any method available in pug-php
$pug->getEngine()->share('globalVar', 'foo');
$pug->getEngine()->addKeyword('customKeyword', $bar);
/**
* @Route("/contact")
*/
public function contactAction()
{
return $this->render('contact/contact.pug', [
'name' => 'Bob',
]);
}
public function registerBundles()
{
$bundles = [
...
new Pug\PugSymfonyBundle\PugSymfonyBundle(),
];
bin/console assets:publish --env=prod
shell
composer
yaml
parameters:
pug:
expressionLanguage: php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.