Skip to content

Instantly share code, notes, and snippets.

@onliniak
Created September 18, 2019 13:28
Show Gist options
  • Save onliniak/8581ab68bb01db8229b7644b7915c599 to your computer and use it in GitHub Desktop.
Save onliniak/8581ab68bb01db8229b7644b7915c599 to your computer and use it in GitHub Desktop.
Phug templates partial rendering
{
"require":{
"phug/phug":"^0.3.2"
}
}
<?php
include 'vendor/autoload.php';
$pug = new Phug\Renderer([
'expressionLanguage' => 'php',
'cache' => 'views/cache',
'basedir' => 'views',
]);
$pug->displayFile('test');
doctype html
html
head
meta(charset='UTF-8')
link(rel='stylesheet', href='css/skeleton.css')
body.container.row
aside.three.columns
main.six.columns
block content
aside.three.columns
footer
extends layout.pug
block content
b test test test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment