You basically got this answer form someone else already I think, but here is how I do it. I use a single Template for the bulk of my page - with the exception of a form. This particular project already has 150 or so forms.
my $page = $self->load_tmpl('page.tmpl');
my $form = $self->load_tmpl('ap_qsign.tmpl', die_on_bad_params =>
+0);
$form->param($errs) if ref $errs;
$page->param('form_text' => $form->output());
return $page->output();
This is from an app based on CGI::Application. The two templates get loaded, in the form template the VAR substitution is done, then the output of the form is substituted in a normal TMPL_VAR, in this case form_text and then the output of the combined objects is returned and output.
Going back to your original question, the Problem of pointing to template directories is interesting. I had forgotten about it entirely because CGI::Application gives us a tmpl_path method that sets the template location.
Good luck!
jdtoronto
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.