[Maypole] additional_data and template_args
Dave Howorth
Dave.Howorth@acm.org
Sun, 02 Jan 2005 17:36:51 +0000
Peter Speltz wrote:
> $r->addtional_data is called before model processes request. I have
> only ever used additional_data to add some template args. I would
> like to use it to add object specific template args except I can't
> because of where this method is called. ( The model class process
> fetches the objects. ) An example is my menu. The menu data is
> different when I'm listing Customers (working with the customer
> class) than it is if i'm viewing a Customer (working with a specific
> object).
>
> I'm wondering if people use additional_data in a way that it has an
> effect on their model class processing . If not maybe the call to
> $r->additional_data should happen after model processing and before
> view processing.
Hi Peter,
For myself, I don't think I care where additional_data gets called but
I'm not sure why you want to use it.
If you want additional model-related data in the template, can't you
just add it in the action ($r->template_vars->{whatever} = xxx)?
Or just add it directly to the object (sub whatever { return xxx })?
Cheers, Dave
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.7 - Release Date: 30/12/04