Archive for March, 2009

Lightweight Autoloading in the Zend Framework

Posted in Zend Framework on March 30th, 2009 by Jamie – Be the first to comment

The Zend Framework is one of the best things to happen to PHP since the introduction of objects. But one area that’s always bugged me has been Zend_Loader, specifically its autoloader. For a framework with an extremely rigid class naming structure, you’d think the autoloader would be light and intuitive. Yet it’s a lot more complex than it needs to be for most developers, leading to some inefficient code and a lot of ‘require_once’ statements everywhere, most of which, if we play our cards right, can be deleted. So, here’s a little autoloader that I wrote for a current project that does the job in nearly every case. Assuming you’re going to make a method of your Bootstrap class, it’ll look something like:

public static function autoload($path)
{
    include str_replace('_', '/', $path) . '.php';
    return $path;
}

Then when you’re running the bootstrap, change your default registerAutoload() call to:

require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload('Bootstrap');

And that’s it! Erase or comment out those annoying and inefficient require_once statementse. I know, slightly ironic that we need a require_once since the goal is to get rid of them. I never said it was perfect – almost. ;)

The Eight Types of Bad Creative Critics

Posted in Funny on March 30th, 2009 by Jamie – Be the first to comment

It’s been around, but man is it apt. It’s apt, baby!

The Eight Types of Bad Creative Critics

The Eight Types of Bad Creative Critics

What Do We Do About Internet Explorer 6?

Posted in Opinion on March 20th, 2009 by Jamie – Be the first to comment

The grumblings of my fellow web designers and developers about having to support Internet Explorer 6 is not a new topic; some, including myself, would say that it’s been discussed to death. It’s not going away anytime soon, so we should just shut up and deal with it. Right?

Well, now that Internet Explorer 8 is officially out of beta, IE 6 is three versions old. If there were ever a time, as a web developer, to come to a conclusion about how to handle the IE 6 problem, it’s now.

read more »