package Template::Liquid::Tag; { $Template::Liquid::Tag::VERSION = 'v1.0.0' } use base 'Template::Liquid::Document'; sub tag { return $_[0]->{'tag_name'}; } sub end_tag { return $_[0]->{'end_tag'} || undef; } sub conditional_tag { return $_[0]->{'conditional_tag'} || undef; } # Should be overridden by child classes sub new { return Template::Liquid::Error->new( {type => 'Subclass', message => 'Please define a constructor in ' . $_[0] } ); } sub push_block { return Template::Liquid::Error->new( {type => 'Subclass', message => 'Please define a push_block method (for conditional tags) in ' . $_[0] } ); } 1; =pod =head1 NAME Template::Liquid::Tag - Documentation for Template::Liquid's Standard Tagsets =head1 Description Tags are used for the logic in your L. For a list of standard tags, see the L documentation. =head1 Extending Solution with Custom Tags To create a new tag, simply inherit from L and register your block L. For a complete example of this, see L. Your constructor should expect the following arguments: =over 4 =item C<$class> ...you know what to do with this. =item C<$args> This is a hash ref which contains these values (at least) =over 4 =item C The attributes within the tag. For example, given C<{% for x in (1..10)%}>, you would find C in the C value. =item C The direct parent of this new node. =item C The tag as it appears in the template. For example, given C<{% for x in (1..10)%}>, the full C would be C<{% for x in (1..10)%}>. =item C The name of the current tag. For example, given C<{% for x in (1..10)%}>, the C would be C. =item C