Zend_Forms, models, validation and how they all work together is a tricky topic. There are many opinions and many ways to do it. This time I’ll show you what I think could be the answer to validating forms without having to duplicate validation code both in a model class and in your form.
Optimizing JavaScript for extreme performance and low memory consumption
While making WidgetCity, I had to use various measures to speed up the code. In this post, I’ll show you the tricks I learned – some of which I haven’t seen mentioned anywhere else before. A lot of performance optimization tips for JavaScript code involve things that you more typically see in web sites, like minimizing the amount of DOM …
PHP Magic Features
I wrote an article for Packt Publishing about PHP’s magic features: Magic functions, methods and constants. The article has now been published on Packt’s website, and you can read it here!
Do you know a build tool?
Do you have a repetitive task for example in a programming project? Chances are you could automate the steps with a build tool. For example, in one of my JavaScript projects I had to do the following: Put all project files to a zip file: Click each file and each dir, and choose add to zip Rename the zip file, …
Making a custom front controller in Zend Framework
Firstly, apologies for the lack of posts lately. I’m pretty busy with various things right now, so I don’t have much time for blogging. Hopefully I’ll have some pretty interesting/cool stuff to show you later, though! Now, here’s something interesting I spotted recently: Creating a custom front controller for Zend Framework. Federico Cargnelutti is writing a series of posts on …
Integrating FCKeditor with Zend_Form
How to use FCKeditor, or any other WYSIWYG editor, with Zend_Form? Another relatively common question. There are many ways you can do this, but let’s look at these two as they are the best in my opinion: Adding some JavaScript to your view script Creating a Zend_Form_Decorator We’ll be using FCKeditor, but you can apply the techniques shown to others, …
Using a builder to construct complex classes
Sometimes if you have a complex class, which needs to be set up in a specific way: Perhaps it takes a lot of constructor arguments, or often requires calling some setters. Having something like that can make it more difficult to understand the code. In a case like this, you may want to consider using a builder class, which is …
Improving Ajax performance in Zend Framework applications
A common reason to use Ajax in a website is to make it feel faster, so you usually want Ajax requests be processed as quickly as possible. While there are many ways to speed up Zend Framework based applications, there are still some things like routing and dispatching which still add up to the total. There is, however, another way …
Improved PDF generation with RE Framework RE_Pdf
I’ve previously written a post on creating a PDF generator class using Zend_Pdf, which detailed some Zend_Pdf usage and introduced a class which could be used to create PDFs easily based on an XML configuration file or such. Zend_Pdf, while generally quite good, has one big issue: It does not support word wrapping text! There’s a new and still a …
Zend_Controller actions that accept parameters?
In some MVC style frameworks the controller’s action methods take parameters in the method signature, ie. someMethod($userId) Zend Framework controllers do not – in ZF, you access parameters through the request object in the controller itself. I thought it would be nice to get the parameters you want in the method, so let’s check out how to do that and …