Peter Speltz wrote:
I think Maypole's stategy is that one person can get a quick app up
and running. It would be easy to make a TT template to put variables
in and have it processed in the header.
http://www.template-toolkit.org/docs/default/FAQ/FAQ.html#How_can_I_configure_variables_on_a_per_request_basis_
Also the view could pre process it :
my $template = Template->new({
PRE_PROCESS => [ 'config', 'header' ],
POST_PROCESS => 'footer',
};
http://www.template-toolkit.org/docs/default/Manual/Config.html#Template_Processing_Options
Then have a template "config" in the temlate root that defines the
variables for human names and such:
[% TABLES = {
beer ={ singular = "Beer" , plural = "Beers" }
...
}
%]
Yup, this is the kind of thing I'd like to see adopted. I wouldn't
pre-process the header template though, because it can include
page-specific content. A good example is the <title> element.
An approach we could take to this is to distincly classify the types
of configuration variables. Heres a quick classification:
Application configuration
-- User Interface (column/table names,) Go in a template
-- Model and Maypole (required_cols, ignore_cols, all cols, base
model, uri_base, display_columns, list_columns ...) Go in $r->config
/ perl code
Model Configuration
-- ????
I can 't think of any Model configs off the bat.
I'd like to see Maypole->config->model_options, just like
Maypole->config->view_options.
Anyone wondering why
display_columns is an App config rather than Model config? IMO, you
may have the same model used in different applications but different
requirements for display list columns. Really the way they are
implemented it could be either i guess.
Well, display_columns is only used by the templates, so IMHO it
shouldn't be a method at all, just a static list in the config template.
Cheers, Dave
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel