[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cgiapp] ANNOUNCE BETA: CGI::Application::Template 0.01


Hi David --

> I'm just having a look through your module to give you some 
> feedback. I notice 
> in the app_module.tmpl when you are writing the run modes 
> there is a variable 
> for mode_template but it isn't mentioned in your docs or in 
> the code. Is this 
> an unimplemented feature or have I missed something.

Not-yet-implemented feature.  I wanted to get this in front of you all,
so I didn't finish it.


> After just a quick look, I think I could probably use this 
> module. I would use 
> it in a macro in my code editor to start new applications. 
> The mode_template 
> function would be useful for me in this case.

In a nut-shell, I imagined a method through which you could define a
hash-table which would contain a map of run-modes to templates:

	$self->run_mode_templates(
		list_widgets  => 'list_view.tmpl',
		add_widget    => 'detail_view.tmpl',
		insert_widget => '',
		edit_widget   => 'detail_view.tmpl',
		update_widget => '',
		delete_widget => '',
	);

Modes which don't have templates assigned would presumably be coded by
the programmer as to return the output of another run-mode upon
completion.  These run-modes would be output by CGI-App-Tmpl like this:

    sub delete_widget {
        my $self = shift;

        my $q = $self->query();
        my $dbh = $self->param('DBH');

        return $self->dump_html();
    }


All run-modes with templates would be output like this:

    sub list_widgets {
        my $self = shift;

        my $q = $self->query();
        my $dbh = $self->param('DBH');

        # Load HTML::Template file for this run-mode
        my $t = $self->load_tmpl('list_view.tmpl');

        return $t->output() . $self->dump_html();
    }


What do you think?


TTYL,

-Jesse-


--

  Jesse Erlbaum
  The Erlbaum Group
  suppressed
  Phone: 212-684-6161
  Fax: 212-684-6226




---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.