Smarty
Zend Translate is a great piece of kit, allowing you to switch between translation adapters with the flick of a few keys. GetText is my sin of choice, and that is what I’ll be talking about here. GetText itself can scan over projects and pick up all the translations, and drop them into your PO files. This is fantastic, as long as you stick to the extremely strict methods that GetText defines. But if I’m using Smarty translation blocks, how do I get GetText to pick them up? Because am I hell adding them all in by hand!
Continue reading “Zend Framework – GetText, Smarty and Automatically Adding The Translations” »
The Smarty template language, as you may know, can assign PHP variables to smarty tokens, which are used within the template. The problem arises when we need to use custom offsets for an array. While using a single variable for an offset is fine, trying to use another array offset as an offset for the first array can start to cause headaches.
With the Smarty 3 release candidates, and the final release itself, the Foreach syntax has changed to reflect a more PHP-based syntax. As the documentation is still a little sparse, and the workings of it are still a little new to most of the old Smarty 2 users, I’ve bundled up this article with a few code examples with the various properties.