On Fri, 3 Dec 2004, Jason Purdy wrote:

> 1) Class::DBI Integration
> I'm just starting to pick up CDBI (I know, I'm late to the party ;)) and it's
> kind of frustrating to get the data into the template.  Or it could be made
> easier.  I'm not sure if we're talking Plugin or an update to the core, but
> what would be really cool is to accept CDBI objects in the 'associate'
> parameter:
> 
> $user_record = CDBI::Subclass->retrieve( $primary_key );
> $template = $self->load_tmpl(
>     'main.TMPL',
>     'die_on_bad_params' => 0,
>     'associate'         => [ $query, $user_record ],
>   );

The associate feature is a pretty brutal hack as it is.  I think you'd
be better off creating a sub-class of HTML::Template which supported a
new option like 'class_dbi' for this functionality.  You could then
call param() using some pre-defined translation between Class::DBI
space and HTML::Template space.

> Another cool tweak would be to HTML::Template such that you could do a search
> on the CDBI object and just pass along the results:
> 
> @results = CDBI::Subclass->search(
>     'year' => '1980'
>   );
> $template->param( 'results' => [EMAIL PROTECTED] );

That should also be reasonably easy to do in a sub-class.

> 2) Status Messages
> In an app flow like A -> B -> A, I would like to have a status message on A
> when B has been successfully processed, but what's the best way to do this?
> Stuff the message in cgiapp's param?  Pass along a param to the runmode
> method?  Then pass that to the template as a param?

I wrote a message about this on the CGI-App mailing-list a while
back.  Let's see if I can find it.  Here it is:

  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/msg01987.html

I'm still planning to write that article...

-sam


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to