[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cgiapp] Re: OT: Class::DBI passing data to templates


Rhesa Rozendaal wrote:
> What I generally do is this:
> (1)    $tmpl->param( map { $_->name => $obj->$_() } $obj->columns );
> 
> A quick and dirty way is using the private _data_hash method:
> (2)    $tmpl->param( $obj->_data_hash );

Beware, _data_hash does *not* populate the field(s) making up the
primary key of the object.  I learned that the hard way.

--[Lance]

-- 
 Carolina Spirit Quest  http://www.carolinaspiritquest.org/
 Celebrate The Circle   http://www.celebratethecircle.org/
 My LiveJournal  http://www.livejournal.com/users/labrown/
 GPG Fingerprint: 409B A409 A38D 92BF 15D9 6EEE 9A82 F2AC 69AC 07B9

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.