[Catalyst] putting an object in the stash

Octavian Rasnita orasnita at gmail.com
Tue Mar 13 13:15:41 GMT 2007


From: "Daniel McBrearty" <danielmcbrearty at gmail.com>

> Impossible to know what you mean here without an example of the
> template, but I commonly put DBIC objects on the stash, and call
> methods on them with the dot operator in TT. TT is smart enough to
> work out what needs to be done and do it
>
> so whether the underlying code is
>
> $obj->element;
>
> or
>
> $obj->{element};
>
> [%- obj.element -%]
>
> works. (Maybe it always uses the second version - as I've never had a
> problem, I've never looked ...
>
> So I don't really get what the problem is here.

Hi,

The problem appears when I want to use only [% element %] and not [% 
obj.element %] in templates.
And I want to use the first way because there are very many variables and it 
is more simple.

Octavian




More information about the Catalyst mailing list