conquer / pug
Pug renderer for the Yii2 framework
1.1.0
2026-11-07 05:25 UTC
Requires
- php: ^7.4 || ^8.0
- pug-php/pug: ^3.0
- yiisoft/yii2: ~2.0.14
Requires (Dev)
- phpunit/phpunit: ^9.6
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-07 05:30:40 UTC
README
Description
Renders .pug views with pug-php 3 (Pug, formerly Jade).
Requirements
- PHP 7.4 or 8.x
- Yii 2.0.14 or later
Installation
composer require conquer/pug:^1.1
Usage
'components' => [ 'view' => [ 'renderers' => [ 'pug' => [ 'class' => conquer\pug\PugRenderer::class, 'debug' => YII_DEBUG, ], ], ], ],
return $this->render('index.pug', ['title' => 'Hello']);
extends layout block content h1= $title p= $this->context->id
Expressions are PHP: $this is the view, as in PHP views. = HTML-encodes the value, != outputs it as is.
| Property | Default | Description |
|---|---|---|
cachePath |
@runtime/Pug/cache |
Directory of the compiled templates |
cacheDuration |
0 |
Seconds after which a template is compiled again; 0 to keep it until a template changes |
debug |
false |
Compile on every render and pretty-print the HTML |
options |
[] |
Options of pug-php |
filters |
[] |
Filters: name => callable |
keyWords |
[] |
Keywords: name => callable |
A template is compiled again when it or a template it includes or extends changes.
License
conquer/pug is released under the MIT License. See the bundled LICENSE for details.