NAME

Top Close Open

Template:TT3::Element::TagStart - element representing a tag start token

DESCRIPTION

Top Close Open

This module implements a subclass of Template::TT3::Element::Whitespace to represent a token indicating the start of a template tag, e.g. [%, %%, [?, etc.

METHODS

Top Close Open

This module implements the following methods in addition to those inherited from the Template::TT3::Element::Whitespace , Template::TT3::Element , Template::TT3::Base and Badger::Base base classes.

next_skip_ws($token)

Top Close Open

This method implements some custom handling for skipping over whitespace when parsing tokens into an expression tree.

In the case of parse-time control directives (e.g. [? TAGS '(* *)' ?]) we want to hide the tokens inside the directive from the expression parser because they have already been interpreted at tokenising time and don't equate to runtime expressions that the parser understands.

So the tokeniser for these tags adds a BRANCH entry in the start token for the directive that points to the end token. When either of the next_skip_ws() or skip_ws() methods are called on one of these start tokens (as we always do when a whitespace token parse_expr() method is called) then we jump straight down to the end token and continue from there.

For all other tags, we advance to the next token as usual.

skip_ws($token)

Top Close Open

An alias to the next_skip_ws() method.

view($view)

Top Close Open

This method is called by a Template::TT3::View object as part of the double dispatch process that is used to render views of template elements. It calls the view_tag_start() method against the view object passed as the only argument, $view. It passes itself as an argument to the view_tag_start() method.

AUTHOR

Top Close Open

Andy Wardley http://wardley.org

COPYRIGHT

Top Close Open

Copyright (C) 1996-2009 Andy Wardley. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Top Close Open

This module inherits methods from the Template::TT3::Element::Whitespace , Template::TT3::Element , Template::TT3::Base and Badger::Base base classes.

It is constructed using the Template::TT3::Class::Element class metaprogramming module.

The Template::TT3::Element::TagEnd module implements a related element used to represent the end of an embedded tag.


http://tt3.template-toolkit.org/docs/Template/TT3/Element/TagStart.pm last modified 2009-12-20 13:34:52