I and I handlers.
=item TableTiler
=over
=item Condition
a bidimensional array value
=item Action
magic generation of HTML table. No need to create and use a HTML::TableTiler object: this handler will manage it magically.
=item Description
The bidimensional array:
$matrix_generating_a_table = [ [1..3],
[4..6],
[7..9] ];
The template could be as simple as a simple label with the same identifier of the bidimensional array:
paragraph text
other paragraph
so the output will be a generic table including the array data:
paragraph text
1
2
3
4
5
6
7
8
9
paragraph text
or the template could be a complete table I included in a block with the same identifier of the bidimensional array, and with the optional ROW and COL TableTiler modes, passed as label attributes:
paragraph text
?
?
?
?
other paragraph
so the output will be a complete tiled table including the array data:
paragraph text
1
2
3
4
5
6
7
8
9
paragraph text
See L for details about this module.
Note: if your template don't need this specific handler you can avoid its loading by explicitly omitting it:
$tm = new Template::Magic::HTML
value_handlers => [ qw( SCALAR
REF
CODE
ARRAY
HASH
FillInForm ) ] ;
B: since this handler checks for a bidimensional ARRAY, it must be checked BEFORE the ARRAY value handler in order to work.
=back
=item FillInForm
=over
=item Condition
a CGI query object value (or by a blessed object that has a param() method)
=item Action
magic fill in of a HTML form with the parameter in the CGI object
=item Description
The CGI object in your code:
$my_query = new CGI;
If you want to fill a form with the param in the $my_query, just transform the form into a block giving it the same identifier.
One useful application of this handler is when a user submits an HTML form without filling out a required field. FillInForm handler will magically redisplay the form with all the form elements (input, textarea and select tags) filled with the submitted info ($my_query), without any other statement in your code. (No need to create and use a HTML::FillInForm object: this handler will manage it magically).
You can use this handler to fill the form with default values too, To do this, just create a new query object and fill it with the default param that you want in the form:
$query = new CGI;
$query->param( name => 'John',
surname => 'Smith', ...);
You can pass an array of ignore_fields (see L for details) by using the attributes like this:
See L for details about this module.
Note: if your template don't need this specific handler you can avoid its loading by explicitly omitting it:
$tm = new Template::Magic::HTML
value_handlers => [ qw( SCALAR
REF
CODE
TableTiler
ARRAY
HASH ) ] ;
=back
=back
=head1 SEE ALSO
=over
=item * L
=item * L
=item * L
=item * L
=back
=head1 SUPPORT
Support for all the modules of the Template Magic System is via the mailing list. The list is used for general support on the use of the Template::Magic, announcements, bug reports, patches, suggestions for improvements or new features. The API to the Magic Template System is stable, but if you use it in a production environment, it's probably a good idea to keep a watch on the list.
You can join the Template Magic System mailing list at this url:
L
=head1 AUTHOR and COPYRIGHT
© 2004-2005 by Domizio Demichelis (L)
All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as perl itself.
=cut