Blog :: Tech roundup
Random bits of wisdom and link roundup for the day:
I mentioned recently that some of my frustration lately was due to maintaining other people's code. Some of it, unfortunately, was due to my own technology choices. I'll have an extensive writeup of some QuickForm/Rendering/Template issues I've been struggling with lately, but in the meantime may I say that if you're going to use PEAR libs, Flexy is the only sane templating choice. I've tended to use Sigma templates (because back in the day I used phplib templates) because (I argued) it's better not to embed logic in the templates that the creatives will be editing...) This is wrong on a whole variety of levels, not least that whether you indicate template loops via html comments (as in sigma) or by flexy:foreach as in flexy, you still have logic in the template. One of these ways, however, produces verbose templates that violate the DRY rule badly (with Sigma you typically have your html element that will loop: say a <tr>, your html comment that indicates the loop, and then you still have to explicitly parse loops in the php code driving the template. Yuck.) Additionally, Flexy provides some nice features like auto escaping variables, and using xml namespace notation on attributes to keep your uncompiled templates mostly viewable in the browser.
Now I might mention that the documentation for Flexy leaves something to be desired (can we convert pear.php.net to wiki format already?). No mention of the flexy:raw (very needed!) There are also some missing features: I'd love to have Kid's replace feature, but on the whole, very useable. I've got some simple flexy howto stuff here, and I'll have more to say about this later.