\Tale\JadeFilter

Provides basic, static filters for the compiler.

The only reason this class exists is so that you don't have do write this basic stuff yourself.

This class provides the following filters for the Compiler:

:plain => Converts to plain text :js => Converts to :css => Converts to :php => converts to <?php ? >

Summary

Methods
Properties
Constants
wrapTag()
wrapCode()
filterPlain()
filterStyle()
filterScript()
filterCode()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

wrapTag()

wrapTag(string  $tag, \Tale\Jade\Parser\Node  $node, string  $indent, string  $newLine) : string

Wraps a node $node in tags using $tag.

Respects indentation and new-lines based on $indent and $newLine

Parameters

string $tag

the tag to wrap the node in

\Tale\Jade\Parser\Node $node

the node to be wrapped

string $indent

the indentation to use on each child

string $newLine

the new-line to append after each line

Returns

string —

the wrapped PTHML-string

wrapCode()

wrapCode(\Tale\Jade\Parser\Node  $node, string  $indent, string  $newLine) : string

Similar to wrapTag, but rather puts PHP-instruction-tags around the text.

This will create working PHP expressions.

If <?php or ? > are already found, they will be trimmed and re-appended correctly to avoid failing nested expressions (<?php cant be used inside <?php)

Parameters

\Tale\Jade\Parser\Node $node

the node to be wrapped

string $indent

the indentation to use on each child

string $newLine

the new-line to append after each line

Returns

string —

the wrapped PHP-string

filterPlain()

filterPlain(\Tale\Jade\Parser\Node  $node, string  $indent, string  $newLine) : string

A plain-text filter that just corrects indentation and new-lines.

Parameters

\Tale\Jade\Parser\Node $node

the node to be wrapped

string $indent

the indentation to use on each child

string $newLine

the new-line to append after each line

Returns

string —

the wrapped PTHML-string

filterStyle()

filterStyle(\Tale\Jade\Parser\Node  $node, string  $indent, string  $newLine) : string

Wraps the content in <style></style> tags and corrects indentation and new-lines.

Parameters

\Tale\Jade\Parser\Node $node

the node to be wrapped

string $indent

the indentation to use on each child

string $newLine

the new-line to append after each line

Returns

string —

The wrapped PTHML-string

filterScript()

filterScript(\Tale\Jade\Parser\Node  $node, string  $indent, string  $newLine) : string

Wraps the content in <script></script> tags and corrects indentation and new-lines.

Parameters

\Tale\Jade\Parser\Node $node

the node to be wrapped

string $indent

the indentation to use on each child

string $newLine

the new-line to append after each line

Returns

string —

the wrapped PTHML-string

filterCode()

filterCode(\Tale\Jade\Parser\Node  $node, string  $indent, string  $newLine) : string

Wraps the content in PHP-compiler tags and corrects indentation and new-lines.

Parameters

\Tale\Jade\Parser\Node $node

the node to be wrapped

string $indent

the indentation to use on each child

string $newLine

the new-line to append after each line

Returns

string —

the wrapped PHP-string