Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: HTML::Template, CGI:Application and design methodologies

by rchiav (Deacon)
on Feb 10, 2004 at 23:22 UTC ( [id://328143]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: HTML::Template, CGI:Application and design methodologies
in thread HTML::Template, CGI:Application and design methodologies

My concern with having everything in essentially one template (rather one template that includes other templates that include other templates) is that it might overcomplicate the data structure. In the small app I'm currently working on, I create 3 or 4 template objects and print each of their outputs. Each invocation of these templates is presenting data from unrelated queries.

I guess I'm just going to have to try it and see how well it works.

  • Comment on Re: Re: HTML::Template, CGI:Application and design methodologies

Replies are listed 'Best First'.
Re: Re: Re: HTML::Template, CGI:Application and design methodologies
by Trimbach (Curate) on Feb 11, 2004 at 07:55 UTC
    In the small app I'm currently working on, I create 3 or 4 template objects and print each of their outputs. Each invocation of these templates is presenting data from unrelated queries.

    This is just a suggestion on how this might be managed (and simplified) with one template object:

    sub some_mode { my $tmpl_object = $self->load_tmpl('my_tmpl.html'); $tmpl_object->param( param1 => 'foo' param2 => 'bar', param3 => 'baz'); # Poke the data for the top part of the page into the $tmpl_object get_top($tmpl_object); # Ditto for the left side of the page get_left($tmpl_object); # Display the entire templated page return $tmpl_object->output; }

    Of course you can add parameters to get_top() and get_left() to fine tune their output on a mode-by-mode basis, but by passing around one template object at a time things may become much simpler than having your program eat its tail calling one recursive mode within a mode within a mode after another.

    Gary Blackburn
    Trained Killer

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://328143]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.