\TaleJade

Namespaces

Compiler
Lexer
Parser
Renderer

Classes

Compiler Compiles an AST got from the parser to valid PHTML, HTML or XML.
Filter Provides basic, static filters for the compiler.
Lexer Performs lexical analysis and provides a token generator.
Parser Takes tokens from the Lexer and creates an AST out of it.
Renderer Allows easy rendering of Jade-files to markup.

Functions

create_renderer()

create_renderer(array|null  $options = null, \Tale\Jade\Compiler|null  $compiler = null, \Tale\Jade\Parser|null  $parser = null, \Tale\Jade\Lexer|null  $lexer = null) : \Tale\Jade\Renderer

Creates a new Tale Jade Renderer instance to render Jade files.

Use the ->render() method on the resulting object to render your jade files

Parameters

array|null $options

the options to pass to the renderer

\Tale\Jade\Compiler|null $compiler

the compiler to use inside the renderer

\Tale\Jade\Parser|null $parser

the parser to use inside the compiler

\Tale\Jade\Lexer|null $lexer

the lexer to use inside the parser

Returns

\Tale\Jade\Renderer

the newly created renderer

render()

render(string  $file, array|null  $args = null, array|null  $options = null) : string

Renders a file through a renderer that is created on-the-fly.

To specify a directory to render from, use the 'paths'-option of the compiler like this:

 render('some-file', [<args>], [
     'paths' => [__DIR__.'/path/to/views']
 ]);

Parameters

string $file

the relative file path to compile

array|null $args

the variables to pass to the template

array|null $options

the options to pass to the renderer

Returns

string —

the rendered markup