Twig API
Class

Twig_TokenParser_Spaceless

class Twig_TokenParser_Spaceless extends Twig_TokenParser

Remove whitespaces between HTML tags.

<pre>
{% spaceless %}
<div>
<strong>foo</strong>
</div>
{% endspaceless %}

{# output will be <div><strong>foo</strong></div> #}
</pre>

Methods

setParser(Twig_Parser $parser)

Sets the parser associated with this token parser

from Twig_TokenParser
Twig_NodeInterface parse(Twig_Token $token)

Parses a token and returns a node.

decideSpacelessEnd(Twig_Token $token)

string getTag()

Gets the tag name associated with this token parser.

Details

in Twig_TokenParser at line 27
public setParser(Twig_Parser $parser)

Sets the parser associated with this token parser

Parameters

Twig_Parser $parser A Twig_Parser instance

at line 34
public Twig_NodeInterface parse(Twig_Token $token)

Parses a token and returns a node.

Parameters

Twig_Token $token A Twig_Token instance

Return Value

Twig_NodeInterface A Twig_NodeInterface instance

at line 45
public decideSpacelessEnd(Twig_Token $token)

Parameters

Twig_Token $token

at line 55
public string getTag()

Gets the tag name associated with this token parser.

Return Value

string The tag name