Permalink
Browse files

version 0.6

  • Loading branch information...
Ido Perlmuter
Ido Perlmuter committed Feb 24, 2010
1 parent dbbe0c8 commit d2417dc3c04e59b99717cd9d79781dc5a326a377
Showing with 313 additions and 31 deletions.
  1. +1 −0 .gitignore
  2. +4 −1 Changes
  3. +1 −0 MANIFEST
  4. +3 −2 README
  5. +4 −3 lib/Tenjin.pm
  6. +42 −1 lib/Tenjin/Context.pm
  7. +231 −24 lib/Tenjin/Template.pm
  8. +26 −0 t/test_capt.html
  9. +1 −0 t/test_tmpl.pl
View
@@ -12,3 +12,4 @@ pm_to_blib*
cover_db
pod2htm*.tmp
Tenjin-*
+*.cache
View
@@ -3,9 +3,12 @@ Revision history for Perl extension Tenjin
0.06 2010-02-24 00:00:00
- Restored the layout template feature which went MIA on 0.05
- Broadened the documentation for the layout template feature
- - Made the utility functions available in Tenjin::Context again
+ and macro functions
+ - Made the utility functions available in templates natively again
- Added documentation for all modules and methods
- Fixed bug when preprocessing templates
+ - Made a test script (not yet an actual CPAN test)
+ - Cleaned distro files
0.052 2010-02-19 01:06:00
- Pointless update to remove git files from the release
View
@@ -26,3 +26,4 @@ t/test_tmpl.pl
t/test_tmpl.html
t/test_layout_tmpl.html
t/test_layout_tmpl_2.html
+t/test_capt.html
View
5 README
@@ -118,11 +118,11 @@ METHODS
every 10 seconds. If you find this value is too low, you can override
the $Tenjin::TIMESTAMP_INTERVAL variable with your preferred value.
-INTERNAL METHODS
register_template( $template_name, $template )
Receives the name of a template and its Tenjin::Template object and
stores it in memory for usage by the engine.
+INTERNAL METHODS
get_template( $template_name, $context )
Receives the name of a template and the context object and tries to find
that template in the engine's memory. If it's not there, it will try to
@@ -202,7 +202,8 @@ CHANGES
present.
Version 0.06 (this version) restored the layout template feature which
- was accidentaly missing in version 0.05.
+ was accidentaly missing in version 0.05, and the ability to call the
+ utility methods of Tenjin::Util natively inside templates.
TODO
* Expand pod documentation and properly document the code, which is
View
@@ -202,8 +202,6 @@ sub render {
return $output;
}
-=head1 INTERNAL METHODS
-
=head2 register_template( $template_name, $template )
Receives the name of a template and its L<Tenjin::Template> object
@@ -218,6 +216,8 @@ sub register_template {
$self->{templates}->{$template_name} = $template;
}
+=head1 INTERNAL METHODS
+
=head2 get_template( $template_name, $context )
Receives the name of a template and the context object and tries to find
@@ -440,7 +440,8 @@ templates structure and WILL cause your application to fail if present.
=back
Version 0.06 (this version) restored the layout template feature which was
-accidentaly missing in version 0.05.
+accidentaly missing in version 0.05, and the ability to call the utility
+methods of L<Tenjin::Util> natively inside templates.
=head1 TODO
View
@@ -30,6 +30,9 @@ or more correctly, for evaluating the Perl code created from the templates,
first integrating the context variables to them, and returning the rendered
output.
+Finally, this module makes the Tenjin utility methods of L<Tenjin::Util>
+available natively inside templates. See L<Tenjin::Util> for more info.
+
=head1 INTERNAL METHODS
=head2 new( [\%vars] )
@@ -139,6 +142,44 @@ sub _build_decl {
return $s;
}
+=head1 UTILITY METHODS
+
+These methods are defined in L<Tenjin::Util> and used here so they are
+made available natively inside templates. See L<Tenjin::Util> for more
+information.
+
+=head2 _p( $expr )
+
+=head2 _P( $expr )
+
+=head2 escape( $expr )
+
+=head2 escape_xml( $expr )
+
+=head2 unescape_xml( $expr )
+
+=head2 encode_url( $url )
+
+=head2 decode_url( $url )
+
+=head2 checked( $expr )
+
+=head2 selected( $expr )
+
+=head2 disabled( $expr )
+
+=head2 nl2br( $text )
+
+=head2 text2html( $text )
+
+=head2 tagattr( $name, $expr, [$value] )
+
+=head2 tagattrs( %attrs )
+
+=head2 new_cycle( @items )
+
+=cut
+
# this makes the Tenjin utility methods available to templates 'natively'
*_p = *Tenjin::Util::_p;
*_P = *Tenjin::Util::_P;
@@ -162,7 +203,7 @@ __END__
=head1 SEE ALSO
-L<Tenjin>, L<Tenjin::Template>.
+L<Tenjin>, L<Tenjin::Util>, L<Tenjin::Template>.
=head1 AUTHOR
Oops, something went wrong.

0 comments on commit d2417dc

Please sign in to comment.