Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Forcing context of dot operator in Template Toolkit

by agianni (Hermit)
on Oct 26, 2007 at 19:11 UTC ( #647471=note: print w/ replies, xml ) Need Help??


in reply to Forcing context of dot operator in Template Toolkit

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.baz

or

foo.get_baz

which 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.

perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(joi +n(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79 +*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'


Comment on Re: Forcing context of dot operator in Template Toolkit
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://647471]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2014-08-02 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (53 votes), past polls