[Catalyst] RE: Need some DBIC syntax help

Matt S Trout dbix-class at trout.me.uk
Sat Dec 31 16:55:38 CET 2005


On Fri, Dec 30, 2005 at 05:13:36PM -0800, Dennis Daupert wrote:
> Oh geez, never mind, I just figured out he's sending me back an array of hashrefs. I just needed the correct deref statement:
>  
>  
>            [% FOREACH user IN Users %]
>                  <h4>[% user.username %]</h4>

Not actually an array of hashrefs, an array of objects - although in TT
you wouldn't notice the difference for simple operations. OTOH you could do

[% user.username("Foo"); user.update() %]

and DBIx::Class would happily update the database - note that this is a
demonstration only, I'm really not recommending you change your database
from your view template :)

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list