Site update: Added Articles section

Tags:

I’ve added a brand new Articles section to the codeutopia.net website. Its purprose is to make it easier to find information on specific topics from the blog. I’ve written a lot of posts, and it can be difficult to find interesting ones by just searching or browsing the blog archives. The articles section groups most of my posts into a …

Improved PDF generation with RE Framework RE_Pdf

Tags:

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 …

Twitter thoughts

Tags:

I’ve been using Twitter for a while now. You can find me here. But what about Twitter? What’s it useful for? How to cope with the constant stream of mostly unimportant updates from the ton of people you follow?

Zend_Controller actions that accept parameters?

Tags:

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 …

A more user-friendly date-based search

Tags:

Recently in one of my freelance projects, the client needed a feature that allows them to search the database for records with a date between two specific dates. Rather than opting for the typical three text fields + a date selector, I added a little trick to make it better…

Object-Oriented JavaScript book review

Tags:

I was recently contacted by Packt Publishing, and asked if I wanted to review a book they published – Object-Oriented JavaScript, written by Stoyan Stefanov. I hadn’t reviewed books before, but I decided to give it a shot! As stated on Packt’s website, by reading the book you will learn: Create scalable, reusable high-quality JavaScript applications and libraries Learn to …

Database backed Zend_Form elements

Tags:

A relatively common task when working with forms is filling select boxes or checkbox and radiobutton lists from a database. It’s not very tricky to query a database, and fill a Zend_Form element’s possible values from the resultset, but it can be quite boring and extraneous code…
We could also create an element which we can give some SQL, and it’ll fill itself automatically! This way you can even define database-backed elements in XML or INI configuration files.

Sending files better: Apache mod_xsendfile and PHP

Tags:

I have previously written a quick post on making files downloadable through PHP scripts. The example in the post reads the file itself into a variable, and as pointed out in the comments, it’s not necessarily a very good idea especially if you deal with large files. Recently at work, we needed a reliable way to send files to users’ …