Internationalization and localization means making your site usable in more than one languages. Well, to be honest, you could call a site that’s only in english localized to english visitors too, but in any case… These two are also known as I18N and L10N. Can you guess where these acronyms come from? The first and last letter from each word …
Routing and complex URLs in Zend Framework
We were talking about routing on the #zftalk IRC channel. One of the users mentioned that rather than using routes, he was using the __call method in the IndexController. I then asked him why is he doing that, as I knew routes would be more than a good choice for most kinds of URLs. I found out that he was …
Zend Framework initialization shell scripts
I’ve had a couple of cases where I’ve wanted to quickly test some stuff with the Zend Framework. Now, to get the framework up and running, you’ll need a couple of things: Directory structure – controller dirs, view dirs, public_html, etc. etc. .htaccess files – To enable routing Bootstrap Controllers I can never remember what to put in the .htaccess …
How to automatically escape template variables in Zend_View
Escaping any data which comes from the server is important to escape, as it prevents XSS amongst other things. The Zend Framework view component Zend_View let’s you escape template variables with $this->escape($this->variableName), but it doesn’t escape them by default. Wouldn’t it be much nicer if it did that by default, or at least provided you with a variable to turn …
Summing up Smarty and Zend View
I’ve posted a couple of posts related to integrating Smarty with the Zend Framework: Making a Smarty view class based on Zend_View Integrating Zend View Helpers into Smarty I’ve also posted some Zend_View related posts: Using layouts with the Zend ViewRenderer helper Creating a factory-object for building views Let’s wrap up these in a summary of using them and what …
The best Smarty + Zend View Helpers solution!
Originally posted in my old blog at My Opera Coming on again with the Smarty and Zend View related articles, let's this time take a look at how to get Zend's View Helpers running with Smarty. Other examples for this that I have seen use a syntax like this: {helper helper=Url p='array(something)' p2=stuff}, which is kind of ugly and the …
Common Zend_Filter_Input problems
Originally posted in my old blog at My Opera Zend_Filter_Input, while a very useful component of the Zend Framwork, has some oddities that can cause a lot of headache if you can't figure it out right away. Missing fields show up as valid even if they have validators that won't let empty values through NULL values for existing fields to …
Handling Ajax requests in the Zend Framework
Originally posted in my old blog at My Opera Doing Ajax is quite simple these days with the various JavaScript libraries offering easy ways to do it. But how do you do it on the server side, without complicating things too much? Typically, in addition to the Ajax response, you need a traditional page response to a request as well …