Search by

conquer / pug

borodulin

Pug renderer for the Yii2 framework

Package info

github.com/borodulin/yii2-pug

Type:yii2-extension

pkg:composer/conquer/pug

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.0 2026-11-07 05:25 UTC

This package is auto-updated.

Last update: 2026-11-07 05:30:40 UTC


README

Latest Version Total Downloads CI License

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.