Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Dancer2 - How to loop over a ref to a HoH

by arkturuz (Curate)
on Jun 10, 2014 at 08:54 UTC ( #1089398=note: print w/replies, xml ) Need Help??

in reply to Dancer2 - How to loop over a ref to a HoH

This is Template Toolkit 2 right? You cannot have dollar sign ($) in a variable name (like in partners.$partner.TPCOMPNAME), so you're referencing wrong item from the hash. See the docs.

My answer is wrong. See Re^2: Dancer2 - How to loop over a ref to a HoH from fishmonger.

Replies are listed 'Best First'.
Re^2: Dancer2 - How to loop over a ref to a HoH
by fishmonger (Chaplain) on Jun 10, 2014 at 14:41 UTC
      Sorry about that, somehow I missed it, and it's been a long time since I last hacked on Template Toolkit.

      Could this solve your issue?

      <% FOREACH partner IN partners.values %> Partner: <% partner.TPCOMPNAME %> <% partner.TPTYPE %><br> <% END %>

        No, that didn't work under either of the template engines.

        This is what works when using TT.

        [% FOREACH partner IN partners.keys %] Partner: [% partners.$partner.TPCOMPNAME %] [% partners.$partner.T +PTYPE %]<br> [% END %]

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1089398]
[marto]: nah, it's not off screen
[Corion]: Somehow I'm happy that my Javascript mostly targets Firefox nowadays :)
[Corion]: But my conundrum currently is how to do lightweight SQL for maintaining my user database, instead of home-cooking too much of an ORM ;)
[Corion]: But maybe Just Enough of an ORM might be the ticket, that is, just locked hashes read from the DB :)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2018-03-21 12:05 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (267 votes). Check out past polls.