Created
September 18, 2019 13:28
-
-
Save onliniak/8581ab68bb01db8229b7644b7915c599 to your computer and use it in GitHub Desktop.
Phug templates partial rendering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require":{ | |
"phug/phug":"^0.3.2" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'vendor/autoload.php'; | |
$pug = new Phug\Renderer([ | |
'expressionLanguage' => 'php', | |
'cache' => 'views/cache', | |
'basedir' => 'views', | |
]); | |
$pug->displayFile('test'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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