Giter Club home page Giter Club logo

jade-php's Introduction

Jade.php

Build Status

Jade.php adds inline PHP scripting support to the Jade template compiler.

Implementation details

The fork is a complete rewrite, all the code is ported from the original jade project.

All the features from the original are supported but undertested, including inheritance and mixins.

Install using composer

kylekatarnls/jade-php on packagist.org

What's new ?

Jade options

Jade options should be passed to the Jade construction

$jade = new Jade(array(
	'prettyprint' => true,
	'extension' => '.jade',
	'cache' => 'pathto/writable/cachefolder/'
);

Supports for local variables

$data['title'] = 'Hello World';
$jade = new Jade();
$output = $jade->render('file', $data);

Supports for custom filters

Filters must be callable: It can be a class that implements the __invoke() method, or an anonymous function.

$jade->filter('escaped', 'My\Callable\Class');

// or

$jade->filter('escaped', function($node, $compiler){
	foreach ($node->block->nodes as $line) {
		$output[] = $compiler->interpolate($line->value);
	}
	return htmlentities(implode("\n", $output));
});

Built-in filters:

  • :css
  • :php
  • :javascript
  • :escaped
  • :cdata

jade-php's People

Contributors

cjonasw avatar djranger avatar everzet avatar fcrosfly avatar hackaugusto avatar hkjels avatar just-paja avatar kylekatarnls avatar lukegb avatar peniar avatar sadjow avatar sisoftrg avatar soviut avatar sszigeti avatar volter9 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.