In article <[EMAIL PROTECTED]>, Adam Gent wrote:
> Hi All,
>
> I was wondering if some changes to CGI::Application::Generator can be made.
>
> I would like the ability to pass through additional params to the generator
> template for output into the CGI::App Package.
Adam,
I was interested in this as well. I believe I submitted a patch to this
effect. Here it is again, anyhow. Replace the routine in Generator.pm
with this version:
sub output_app_module {
my $self = shift;
my $extra_new_params = shift || {};
my $extra_tmpl_params = shift || {};
my $t = HTML::Template->new_file(
$self->app_module_tmpl(),
global_vars => 1,
path => [EMAIL PROTECTED],
%$extra_new_params,
);
$t->param(
package_name => $self->package_name(),
base_module => $self->base_module(),
start_mode => $self->start_mode(),
run_modes => [ map { {mode_name=>$_} } ($self->run_modes()) ],
use_modules => [ map { {module_name=>$_} } ($self->use_modules()) ],
tmpl_path => $self->tmpl_path(),
new_dbh_method => $self->new_dbh_method(),
%$extra_tmpl_params,
);
return $t->output();
}
#####
Then you can do this kind of thing:
print $cat->output_app_module({die_on_bad_params=>0})
--
http://mark.stosberg.com/
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]