[Koha-devel] OPAC dir structure redesign

Robin Sheat robin at catalyst.net.nz
Wed May 8 00:55:16 CEST 2013


Colin Campbell schreef op di 07-05-2013 om 16:03 [+0100]:
> A lot of the code creates variables for every element. When you have
> to
> invent that many variables the code soon gets inconsistent and buggy.
> If
> we are passing a borrower pass a borrower as a hashref dont
> disassemble
> and reassemble into his constituent part.

I tend to agree with this. I guess that H::T::P was not as capable of
digging into data structures, but for new code, there's no reason to not
pass a borrower, or an array of biblio hashes, or whatever. T::T lets
you do virtually everything you can do in Perl to the structures. This
also leads nicely into having T::T libraries for common display
operations that are needed on many pages.

This said, I'd encourage people to keep in mind having only
display-related logic in the templates, and all other logic in the
appropriate .pl/.pm. It can sometimes be tempting to put things in the
easy place, rather than the right one.

-- 
Robin Sheat
Catalyst IT Ltd.
✆ +64 4 803 2204
GPG: 5957 6D23 8B16 EFAB FEF8  7175 14D3 6485 A99C EB6D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20130508/1b619a27/attachment.pgp>


More information about the Koha-devel mailing list