From: Terrence B. <ba...@me...> - 2005-05-03 06:32:34
|
LD <lds...@ya...> writes: > Hi there, Hi LD, > > > If I have the following as part of a template definition (in a file): > [% self.CGI.h1(self.reflect.package) %] <h1>[% self.reflect.package %]</h1> looks cleaner to my personal taste. > > > ...it returns the proper name as expected. If I however do: > sub someTemplate { \ <<'EOT'; } > [% self.CGI.header %] > [% self.CGI.h1(self.reflect.package) %] > EOT I don't have an answer to your question, but would like to make a comment. One of my initial criticisms of the CGI::Prototype docs was what you are doing here. The call to $self->CGI->header is more general and will apply to many more pages/objects than the current page. It does not belong in the same method as a page-local call such as $self->reflect->package: it is application-wide not page-local. I think it belongs in render_enter in a base class... then, if a particular page needs to send a certain content type, it can override the method. -- Carter's Compass: I know I'm on the right track when, by deleting something, I'm adding functionality. |