* Terrence Brannon <[EMAIL PROTECTED]> [2005-09-03 19:10]:
> This being the case, should these two aspects of the CGI
> response be two different methods, with $self->content_type
> existing in a base class and re-used for most of the app and
> $self->content (which is known as $self->render) be variant on
> each page?

That used to bug me until I started using CGI::Prototype::Hidden,
where the WRAPPER template takes care of this adequately. The
variables are all shared between the main template and the
wrapper, which includes `self`, so you just can do something like

    Content-type: [% self.content_type %]

at the top of the wrapper and have a `content_type` method which
sets the default in your application class, and then change it
for pages which deliver a different type of content.

I found responsibilities are actually separated more cleanly this

*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};

SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
cgi-prototype-users mailing list

Reply via email to