ryan has asked for the wisdom of the Perl Monks concerning the following question:
I've recently discovered HTML::Template and am very happy with what it can do for me. In an effort to learn more I am modifying several previous CGI scripts I made when I didn't know about templating.
One of these scripts is a single CGI that has about 10 'faces', depending on the POST data it displays a totally different interface, such as Admin, File List, Reports etc... The CGI could be split up, but I prefer it in one neat file .. I suppose this is another topic, is cramming heaps into the one file frowned upon? I realise this is a bit of a pandora's box :) It is basically a small file management system in a single file.
I was after some guidance as to the best way to handle this using templates. I so far have thought of making a separate template file for each 'face' and putting a simple conditional IF block in the beginning of a 'generic' HTML template that then imports the specific template required for that face. This method would allow me to still maintain a single CGI file, but keep the multiple 'faces' of the CGI, while still having good code/design separation.
Would this be considered workable? Any thoughts or accepted standards in this area?
TIA .. Ryan
One of these scripts is a single CGI that has about 10 'faces', depending on the POST data it displays a totally different interface, such as Admin, File List, Reports etc... The CGI could be split up, but I prefer it in one neat file .. I suppose this is another topic, is cramming heaps into the one file frowned upon? I realise this is a bit of a pandora's box :) It is basically a small file management system in a single file.
I was after some guidance as to the best way to handle this using templates. I so far have thought of making a separate template file for each 'face' and putting a simple conditional IF block in the beginning of a 'generic' HTML template that then imports the specific template required for that face. This method would allow me to still maintain a single CGI file, but keep the multiple 'faces' of the CGI, while still having good code/design separation.
Would this be considered workable? Any thoughts or accepted standards in this area?
TIA .. Ryan
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Multiple template coordination using HTML::Template
by rob_au (Abbot) on Dec 29, 2001 at 16:17 UTC | |
Re: Multiple template coordination using HTML::Template
by Hero Zzyzzx (Curate) on Dec 30, 2001 at 03:11 UTC | |
by ryan (Pilgrim) on Dec 30, 2001 at 06:49 UTC | |
(jeffa) Re: Multiple template coordination using HTML::Template
by jeffa (Bishop) on Dec 29, 2001 at 22:14 UTC | |
Re: Multiple template coordination using HTML::Template
by dorko (Prior) on Dec 29, 2001 at 19:33 UTC |
Back to
Seekers of Perl Wisdom