PHPackages                             ci-pug/ci-pug - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. ci-pug/ci-pug

ActiveLibrary[Templating &amp; Views](/categories/templating)

ci-pug/ci-pug
=============

HAML-like template engine for CodeIgniter

2.1.1(3y ago)211.8k4MITPHPPHP &gt;=5.4.0CI failing

Since Jun 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/pug-php/ci-pug-engine)[ Packagist](https://packagist.org/packages/ci-pug/ci-pug)[ Docs](https://github.com/ci-jade/ci-jade)[ GitHub Sponsors](https://github.com/kylekatarnls)[ Fund](https://opencollective.com/pug-php)[ RSS](/packages/ci-pug-ci-pug/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (9)Dependencies (2)Versions (11)Used By (0)

ci-pug
======

[](#ci-pug)

ci-pug is a library for CodeIgniter to enable [Pug Template Engine](http://jade-lang.com/) to render views with *.pug* or *.jade* extension.

- all files in the view folder ending with .pug or .jade can be rendered from the controllers, but you can still use any other files as views. So you're free to use Pug for all your views or just some of them.
- use the `'cache' => true` setting to render your views only once and save rendered files the *cache* folder, then serve cached file with no performance loss, views will be loaded as fast as the equivalent php views. You can also use `'cache' => '/your/cutom/path`
- ci-pug wait for you to load it. Only controllers with `use CiPug;`will load the wrapper, and until you call `$this->settings()` or `$this->view()` in the controller, the template engine will not be loaded.

Installation
------------

[](#installation)

You need PHP 5.4 or later to run ci-pug. If you use an earlier version of PHP we recommend you to upgrade. If you cannot, you can download the [library version](https://github.com/pug-php/ci-pug) of ci-pug (available on PHP 5.3).

Open a terminal in the **application** folder in your CodeIgniter project, then enter:

```
composer require ci-pug/ci-pug
```

Be sure `$config['composer_autoload'] = true;` in your **application/config/config.php** file

How to use it?
--------------

[](#how-to-use-it)

#### application/controllers/Main.php

[](#applicationcontrollersmainphp)

```
