Changeset 26876

Show
Ignore:
Timestamp:
12/16/08 19:27:53 (5 years ago)
Author:
kazuho
Message:

doc

Location:
lang/perl/Text-MicroTemplate/trunk/lib/Text
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Text-MicroTemplate/trunk/lib/Text/MicroTemplate.pm

    r26861 r26876  
    441441=head2 fast 
    442442 
    443 Based on C<Mojo::Template>, expressions in the template is perl code. 
     443Based on L<Mojo::Template>, expressions in the template is perl code. 
    444444 
    445445=head2 intelligent 
     
    450450 
    451451Text::MicroTemplate does not provide features like template cache or including other files by itself.  However, it is easy to add you own (that suites the most to your application), by wrapping the result of the module (which is a perl expression). 
     452 
     453The module only provides basic building blocks for a template engine.  Refer to L<Text::MicroTemplate::File> for higher-level interface. 
    452454 
    453455=head1 TEMPLATE SYNTAX 
     
    491493    } 
    492494 
    493 =head2 render_mt($template, $args) 
     495=head2 render_mt($template, @args) 
    494496 
    495497Utility function that combines build_mt and call to the generated template builder. 
     
    530532=head3 escape_func 
    531533 
    532 escape function (defaults to C<Text::MicroTemplate::escape_html>), no escape when set to undef 
     534escape function (defaults to L<Text::MicroTemplate::escape_html>), no escape when set to undef 
    533535 
    534536=head3 package_name 
     
    540542returns perl code that renders the template when evaluated 
    541543 
     544=head1 SEE ALSO 
     545 
     546L<Text::MicroTemplate::File> 
     547 
    542548=head1 AUTHOR 
    543549 
  • lang/perl/Text-MicroTemplate/trunk/lib/Text/MicroTemplate/File.pm

    r26872 r26876  
    7474 
    75751; 
     76__END__ 
     77 
     78=head1 NAME 
     79 
     80Text::MicroTemplate::File - a file-based template manager 
     81 
     82=head1 SYNOPSIS 
     83 
     84    use Text::MicroTemplate::File; 
     85 
     86    our $mtf = Text::MicroTemplate->new( 
     87        include_path => [ $path1, $path2, ... ], 
     88        use_cache    => 1, 
     89    ); 
     90 
     91    # render 
     92    $mtf->render_file('template.file', $arg1, $arg2, ...); 
     93 
     94=head1 DESCRIPTION 
     95 
     96Text::MicroTemplate::File is a file-based template manager for L<Text::MicroTemplate>. 
     97 
     98=head1 PROPERTIES 
     99 
     100Text::MicroTemplate provides OO-style interface with following properties. 
     101 
     102=head2 cache 
     103 
     104cache mode (0: no cache (default), 1: cache with update check, 2: cache but do not check updates) 
     105 
     106=head2 open_layer 
     107 
     108layer passed to L<open> (default: ":utf8") 
     109 
     110=head2 package_name 
     111 
     112package under where template files are compiled (deafult: "main") 
     113 
     114=head1 METHODS 
     115 
     116=head2 build_file($file) 
     117 
     118Returns a subref that renders given template file. 
     119 
     120=head2 render_file($file, @args) 
     121 
     122Renders the template file with given arguments. 
     123 
     124=head1 SEE ALSO 
     125 
     126L<Text::MicroTemplate> 
     127 
     128=head1 AUTHOR 
     129 
     130Kazuho Oku E<lt>kazuhooku gmail.comE<gt> 
     131 
     132=head1 LICENSE 
     133 
     134This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10. 
     135 
     136=cut