How to use built-in SPL exception classes for better error handling

Tags:

Since PHP 5, there has been a bundle of built-in exceptions – the “SPL exceptions” – in PHP. However, the documentation for these classes is quite lacking in examples, and it can be difficult to understand when you should be using them. The short answer is always. You’ll find a longer answer if you continue reading :) There is also …

Writing HTML is fun (if you don’t have to deal with IE)

Tags:

HTML and CSS are relatively straightforward languages. Yet there’s a certain amount of elegancy to them – I think you could even call well written markup art. I quite enjoy writing HTML and CSS from time to time. Despite being simpler than programming languages, writing HTML still provides a challenge: How to put a design into code in the most …

Using spatial data in Doctrine 2

Tags:

In this post I’ll introduce you to extending Doctrine 2 to provide ways to use custom data types and DQL functions. We needed a simple way to store locations and calculate distances between points on maps and some other stuff for Wantlet. Since we are using MySQL, we decided to use MySQL’s Spatial Extensions for it since they seemed suitable. …

What was the point of XHTML?

Tags:

XHTML was the fad for a while – you were a bad coder if your markup wasn’t valid XHTML. Now it’s fading out. Giorgio Sironi’s recent look at what happened to XHTML got me thinking: What was the point of all this? Why was XHTML useful, or was it?

How to create Doctrine 1 -style Soft-Delete in Doctrine 2

Tags:

Doctrine 1 has the concept of behaviors which you could add to your models. One of these was the soft-delete behavior, which allowed you to “delete” records without really deleting them. Doctrine 2 does not have behaviors due to various reasons. However, I needed a way to have a model which worked like soft-delete. Let’s see one approach to creating …

11 common Dojo gotchas

Tags:

Dojo is a great JavaScript toolkit, but it’s not perfect: It has a couple of gotchas that can be hard to debug just based on the error (or the lack of it). To rectify this, here’s a list of some common mistakes and their solutions. It’s usually good to just go through each of these if you can’t figure out …

Zend Framework 1.8 Web Application Development book review

Tags:

So you want to learn to use Zend Framework, and develop a web app with it. Maybe you’ve been looking at a book to help, too. This is what Keith Pope’s book Zend Framework 1.8 Web Application Development promises to teach you. And I think this is the best book for the job. Continue reading to find out why.