PHPackages                             marihachi/tale-jade - 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. marihachi/tale-jade

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

marihachi/tale-jade
===================

A complete and fully-functional implementation of the Jade template language for PHP

1.4.2(10y ago)01.4k11MITPHPPHP &gt;=5.5.0

Since Oct 6Pushed 10y agoCompare

[ Source](https://github.com/marihachi/tale-jade)[ Packagist](https://packagist.org/packages/marihachi/tale-jade)[ Docs](http://jade.talesoft.io)[ RSS](/packages/marihachi-tale-jade/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (25)Used By (1)

Tale Jade for PHP
=================

[](#tale-jade-for-php)

[![GitHub release](https://camo.githubusercontent.com/a7529d5e218bf749696a1819ed9d0f9cab54ee368cbfaa6036e34739ba84d04e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f74616c65736f66742f74616c652d6a6164652e7376673f7374796c653d666c61742d737175617265)](https://github.com/Talesoft/tale-jade) [![Travis](https://camo.githubusercontent.com/a4c9584db89eb3079d2eb2825c088125202f09aa985701d977d71ec38108ca8c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f54616c65736f66742f74616c652d6a6164652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Talesoft/tale-jade) [![Packagist](https://camo.githubusercontent.com/dd5c01f8234b9bececbb104469e70150244e8cf331597b767f98c79320c08dc2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74616c65736f66742f74616c652d6a6164652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/talesoft/tale-jade) [![HHVM](https://camo.githubusercontent.com/fe5261a382eeb9972f532cb0ef41c0056239b6d78d1bcc4783b5ce76ab8e3658/68747470733a2f2f696d672e736869656c64732e696f2f6868766d2f74616c65736f66742f74616c652d6a6164652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Talesoft/tale-jade) [![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/Talesoft/tale-jade/blob/master/LICENSE.md)

> **Finally a fully-functional, complete and clean port of the Jade language to PHP**
>
> *— Abraham Lincoln*

The Tale Jade Template Engine brings the popular and powerful Templating-Language [Jade for Node.js](http://jade-lang.com) to PHP!

Tale Jade is the first complete and most powerful Jade implementation in PHP.

---

**Update Time!**

Tale Jade is receiving a larger update at this time which will bring in more stability, extensibility and better integration possibilities. I'm pretty busy right now, that's why it will take quite a while until it is finished.

If you're starting a larger project right now, be assured that there will be API changes from 1.4 to 1.5. Your Jade files will render just as they did before, but if you add own filters or extend Tale Jade in another way, things might break with the update.

If you know you've extended Tale Jade in 1.4 you might as well just stick to 1.4 (It's pretty stable and functional).

If you want to take a look at what we're up to, check out the [compiler-enhancements branch](https://github.com/Talesoft/tale-jade/tree/compiler-enhancements). It contains the latest updates (It's not a working version yet, though!)

If you want to help out, send PRs.

---

Getting Started
---------------

[](#getting-started)

### Install with [Composer](https://getcomposer.org)

[](#install-with-composer)

[Download Composer](https://getcomposer.org/download/)

The composer package for Tale Jade is called [`talesoft/tale-jade`](https://packagist.org/packages/talesoft/tale-jade)

If you want to get started right now, hook up [composer](https://getcomposer.org/) and run

```
$ composer require "talesoft/tale-jade:*"
$ composer install
```

or add it to your `composer.json` by yourself

```
{
    "require": {
        "talesoft/tale-jade": "*"
    }
}
```

### Install by downloading the sources

[](#install-by-downloading-the-sources)

You can also download the sources by yourself.

Tale Jade is compatible with the [PSR-0](http://www.php-fig.org/psr/psr-0/) and [PSR-4](http://www.php-fig.org/psr/psr-4/) autoloading standards.

Put the sources inside your a `Tale/Jade` subfolder inside your autoloading directories, e.g. `library/Tale/Jade` and you're ready to go!

The easiest way might be to just put a clone of the repository there, that way you can update it easier

```
$ git clone git@github.com:Talesoft/tale-jade.git library/Tale/Jade
```

or as a sub-module if you're using git for your project as well

```
$ git submodule add git@github.com:Talesoft/tale-jade.git library/Tale/Jade
```

### Rendering a Jade Template

[](#rendering-a-jade-template)

Include the `vendor/autoload.php` file of composer in your PHP script and get started with Tale Jade!

```
use Tale\Jade;

//Include the vendor/autoload.php if you're using composer!
include('vendor/autoload.php');

$renderer = new Jade\Renderer();

echo $renderer->render('your-jade-file');
```

This way, the renderer will search for `your-jade-file.jade` in your `get_include_path()`-paths. Notice that the path passed to `render` should be relative. You can give it absolute paths, but it will make caching harder.

We show you how to add alternative search paths further in the **Basic configuration** section below.

When the Jade-file gets rendered, a `./cache/views`-directory is created automatically and the compiled PHTML will be stored in that directory.

To change this directory, use the `cachePath`-option

```
$renderer = new Jade\Renderer([
    'cachePath' => '/your/absolute/cache/path'
]);
```

The Jade-file will now be rendered to that directory on each call.

To enable a cache that won't render the files on each call, use the `lifeTime` option of the `file`-adapter

```
$renderer = new Jade\Renderer([
    'lifeTime' => 3600 //Will cache the file for 3600 seconds (one hour)
]);
```

### Basic configuration

[](#basic-configuration)

To enable formatting of the PHTML-output, use the `pretty`-option

```
$renderer = new Jade\Renderer([
    'pretty' => true
]);
```

If you don't want to use the `get_include_path()`-paths (which could actually harbor a security risk in some cases), pass your own search paths to the Renderer. Rendered and included Jade-files will be searched in those paths and not in the `get_include_path()`-paths anymore.

```
//Either with
$renderer = new Jade\Renderer([
    'paths' => [__DIR__.'/views']
]);

//or with
$renderer->addPath(__DIR__.'/views');
```

As soon as you pass *any* path, the loading from the `get_include_path()`-paths will be disabled and you always load from your passed directory/ies.

To pass variables to your Jade-file, use the second argument of the `render`-method

```
echo $renderer->render('index', [
    'title' => 'Jade is awesome!',
    'content' => 'Oh yeah, it is.'
]);
```

These can be used inside Jade as normal variables

```
h1= $title

+content-block($content)
```

---

Supported features
------------------

[](#supported-features)

We support every single feature the [original Jade implementation](http://jade-lang.com/reference/) supports! This always has been and will always be our main target.

**But why stop there?**PHP has it's own features that are surely different from JavaScript's. By utilizing those features we aim to bring in more, compatible features into the language to make the fastest template development ever possible!

**You can try features and see a bunch of examples on our [sandbox site](http://sandbox.jade.talesoft.io)**

### Supported official Node.js Jade Features

[](#supported-official-nodejs-jade-features)

- [Tags](http://sandbox.jade.talesoft.io)
- [Classes](http://sandbox.jade.talesoft.io?example=classes)
- [IDs](http://sandbox.jade.talesoft.io?example=ids)
- [Doctypes](http://sandbox.jade.talesoft.io?example=html-5)
- [Attributes](http://sandbox.jade.talesoft.io?example=attributes)
- [Mixins](http://sandbox.jade.talesoft.io?example=mixins)
- [Blocks](http://sandbox.jade.talesoft.io?example=blocks)
- [Expressions](http://sandbox.jade.talesoft.io?example=expressions)
- [Escaping](http://sandbox.jade.talesoft.io?example=escaping)
- [Block Expansion](http://sandbox.jade.talesoft.io?example=block-expansion)
- [Assignments](http://sandbox.jade.talesoft.io?example=assignments)
- [Comments](http://sandbox.jade.talesoft.io?example=comments)
- [Code](http://sandbox.jade.talesoft.io?example=code)
- [Inheritance](http://sandbox.jade.talesoft.io?example=inheritance)
- [Includes](http://sandbox.jade.talesoft.io?example=includes)
- [Conditionals](http://sandbox.jade.talesoft.io?example=conditionals)
- [Loops](http://sandbox.jade.talesoft.io?example=loops)
- [Interpolation](http://sandbox.jade.talesoft.io?example=interpolation)
- [Filters](http://sandbox.jade.talesoft.io?example=filters)
- [Mixin Blocks](http://sandbox.jade.talesoft.io?example=mixin-blocks)
- [Variadics](http://sandbox.jade.talesoft.io?example=variadics)

### Supported Tale Jade Features

[](#supported-tale-jade-features)

- [Named Mixin Parameters](http://sandbox.jade.talesoft.io?example=named-mixin-parameters)
- [Attribute Stacking](http://sandbox.jade.talesoft.io?example=attribute-stacking)
- [Variable Access](http://sandbox.jade.talesoft.io?example=variable-access)
- [Do/while and for-Loops](http://sandbox.jade.talesoft.io?example=loops)

### Other cool features

[](#other-cool-features)

- Automatic isset-checks for simple variables with `?`-flag to disable the behavior
- Inbuilt Markdown, CoffeeScript, LESS, SCSS/SASS and Stylus support
- Escapable text for HTML/-PHP-output
- UTF-8 support via PHP's mb\_\* extension
- Indentation detection and support for any indentation kind you like
- Hackable and customizable renderer, compiler, parser and lexer
- Huge amount of (optional) configuration possibilities
- Graceful compiler forgiving many mistakes (e.g. spaces around the code)
- Lightning fast and clean compilation
- Detailed error handling
- Renderer with different adapters
- Intelligent expression parsing based on bracket counting
- Huge documentation available
- Tested well and maintained actively

### There's more to come...

[](#theres-more-to-come)

Tale Jade is actively used and developed in many projects and is improved constantly.

We don't stick to the Jade-convention, but we'll always provide compatibility to Node.js Jade to help reducing confusion.

We love Jade, we love PHP, we love Node.js and we love the official and original Jade-contributors.

**Planned features:**

- Command line tools
- Import Attributes (`include some-file(some-var='some-value')`)
- Helper Libraries (Own custom helper libraries)
- Aliases (Like mixins, just smaller)
- Website Kit for easy website creation with Tale Jade
- Stylus integration
- CoffeeScript integration
- Markdown integration
- Extensions and package manager

---

Documentation Resources
-----------------------

[](#documentation-resources)

[Tale Jade Live Compiler](http://sandbox.jade.talesoft.io)A compiler for you to play with in your browser as well as a whole bunch of examples to give you a grasp of what Tale Jade is capable of.

[The Tale Jade API Docs](http://jade.talesoft.io/docs)The documentation of the Tale Jade source code. Generated with phpDocumentor, but is's fairly enlightening.

[Official Node.js Jade Documentation](http://jade-lang.com)The real thing. This is where everything that we do here originates from. The syntax is the same, only the code-expressions are different.

[Tale Jade Bootstrap](https://github.com/Talesoft/tale-jade-bootstrap)A quick-start project to get you up and running. Fork it, download it, play with it. Don't forget to run `composer install` before launching ([Download Composer](https://getcomposer.org/download/))

[Development Test Files](https://github.com/Talesoft/tale-jade-examples)The example files we tested the engine with. We cover all features somewhere in there, for sure!

[Tale Jade Unit Tests](https://github.com/Talesoft/tale-jade/tree/master/Test)The Unit Tests we're using to ensure stability. There will be new tests added constantly and most features are covered here. It's PHP code, though.

---

Tale Jade in for your favorite framework
----------------------------------------

[](#tale-jade-in-for-your-favorite-framework)

You're using a framework with a template engine already, but you really want to try out Jade? Search no further.

Thanks to the Tale Jade Community we got some modules for existing frameworks that allow you to use Tale Jade easily!

### Laravel Framework

[](#laravel-framework)

- [Official Tale Jade Bridge](http://github.com/Talesoft/tale-jade-laravel)

### Yii2 Framework

[](#yii2-framework)

- [jacmoe's Extension](https://github.com/jacmoe/yii2-tale-jade)

### SimpleMVCFramework

[](#simplemvcframework)

- [Cagatay's SMVC Fork](https://github.com/Talesoft/tale-jade-smvc)

### CakePHP 3

[](#cakephp-3)

- [clthck's Plugin](https://github.com/clthck/cakephp-jade)

### FlightPHP

[](#flightphp)

- [berkus' Integration](https://gist.github.com/berkus/f54347a4a1fd74e9e162)

### Symphony XSLT CMS

[](#symphony-xslt-cms)

*(This is not the Symfony PHP Framework)*

- [vdcrea's Jade Editor](http://www.getsymphony.com/download/extensions/view/111595/)

**Your framework is missing? [Send us an e-mail](mailto:info@talesoft.io) and we'll get a bridge up and running as soon as possible!**

A great thanks to the contributors of these modules!

---

Get in touch
------------

[](#get-in-touch)

If you find a bug or miss a function, please use the [Issues](https://github.com/Talesoft/tale-jade/issues) on this page to tell us about it. We will gladly hear you out :)

Don't forget to [support our work](https://www.paypal.me/TorbenKoehn) if you like it!

If you'd like to contribute, fork us, send us pull requests and we'll take a deep look at what you've been working at! We're completely **Open Source**! You can do anything you like with our code as long as you stick to the **MIT-license** we've appended.

You can also contact us via E-Mail

**Thank you for using Tale Jade. Let us spread the Jade-language together!**

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 91.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Recently: every ~20 days

Total

19

Last Release

3694d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c505a36ae31edbf586a890f35f2c4a170fdc42d2ebbc799faa8160ae8b635dc?d=identicon)[marihachi](/maintainers/marihachi)

---

Top Contributors

[![TorbenKoehn](https://avatars.githubusercontent.com/u/1403556?v=4)](https://github.com/TorbenKoehn "TorbenKoehn (112 commits)")[![marihachi](https://avatars.githubusercontent.com/u/10358431?v=4)](https://github.com/marihachi "marihachi (8 commits)")[![jacmoe](https://avatars.githubusercontent.com/u/85424?v=4)](https://github.com/jacmoe "jacmoe (2 commits)")

---

Tags

phphtmltemplatejadeviewsphtmlpresentationdialect

### Embed Badge

![Health badge](/badges/marihachi-tale-jade/health.svg)

```
[![Health](https://phpackages.com/badges/marihachi-tale-jade/health.svg)](https://phpackages.com/packages/marihachi-tale-jade)
```

###  Alternatives

[phug/phug

Pug (ex-Jade) facade engine for PHP, HTML template engine structured by indentation

67292.2k13](/packages/phug-phug)[talesoft/tale-jade

A clean, lightweight and easy-to-use templating engine for PHP based on Jade/Pug

8919.3k5](/packages/talesoft-tale-jade)[talesoft/tale-pug

A clean, lightweight and easy-to-use templating engine for PHP based on Pug, formerly Jade

319.4k3](/packages/talesoft-tale-pug)[figdice/figdice

Template Engine, XML-centric and attribute-driven

222.4k1](/packages/figdice-figdice)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
