|
|
| Welcome to the Monastery | |
| PerlMonks |
Re: Forcing context of dot operator in Template Toolkitby agianni (Hermit) |
| on Oct 26, 2007 at 19:11 UTC ( #647471=note: print w/ replies, xml ) | Need Help?? |
|
Hey, so it turns out I got this working after all. There was a bug in my test that was forcing the object context. I missed the fact that the original author of the test had overridden my method to explicitly return an object all of the time :) This is to say that now the template always pulls back the hashref instead of the object from Contextual::Return. This works fine for me since it is backwards compatibility from a hashref model that I'm looking for. So in the mean time, I have bi-directional flexibility in my controller code and access to hashrefs in my templates. I have accounted for this by creating entries in the hashref with names identical to the method accessors, so I can call: foo.bar.bazor foo.get_bazwhich both give me the same value, and while the later looks like a method call, it's actually just a hash entry. It's a total kludge, but that's all I'm after right now.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||