DbFramework::Template - Fill template with database values
use DbFramework::Template; $t = new DbFramework::Template($template,\@tables); print $t->fill; $t->default($table); $t->template->set_text($template);
DbFramework::Template is a class for filling templates with values from a database.
The following list describes the placeholders allowed in a template. In each case %values relates to the hash passed to the fill() method.
Replaced with the value from %values whose key is table.column. See "table_qualified_attribute_hashref()" in DbFramework::Persistent for a useful method for generating a hash to fill this type of placeholder.
Replaced with an HTML form field appropriate for the column column in the table table. value is the inital value which will be applied to the field. The type of field generated is determined by the data type of column. This can be overridden by setting type. See "as_html_form_field()" in DbFramework::Attribute for more details.
Replaced with an HTML form field appropriate for the foreign key fk in the table table. See "as_html_form_field()" in DbFramework::ForeignKey for more details.
DbFramework::Util
Create a new DbFramework::Template object. $template is the template to be filled. @tables are the DbFramework::Table objects required for filling the template.
Returns the Text::FillIn object associated with the template.
Returns a filled template. The values in %values are used to fill certain placeholders in the template (see "Template placeholders".)
$table is a DbFramework::Table object. Sets up a default template consisting of all fields in $table.
Text::FillIn and DbFramework::Util.
Paul Sharpe <paul@miraclefish.com>
Copyright (c) 1999 Paul Sharpe. England. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install DbFramework::Key, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DbFramework::Key
CPAN shell
perl -MCPAN -e shell install DbFramework::Key
For more information on module installation, please visit the detailed CPAN module installation guide.