News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
Jaisen Methai's Blog:
Stop including class files and use __autoload() instead
July 02, 2008 @ 11:11:50

On his blog, Jaisen Methai posted about a very handy feature of PHP5 - the __autoload function.

It's one of the gems in PHP that I find to be relatively under used. It's common for PHP applications to break out classes into their own files. This becomes cumbersome when working on large projects as you wind up with numerous include/require calls for any given page.

He shows an example of its usage (loading class files dynamically from a specified directory) and mentions how it can help to make your code a lot less ugly. Comments on the post range in topics - from comparing it to include paths, how the idea was borrowed from PEAR, and how proper naming conventions can make its use even easier.

0 comments voice your opinion now!
include class file autoload php5 tip



Similar Posts

Ivo Jansch's Blog: Validating OCL constraints in PHP objects

PHPit.net: PHP5 Class Basics, Part 1

Richard Lord's Blog: Zend_View helpers in include path

Developer.com: SQLite: The Sensible Database Solution

DevShed: Overloading and Object-Oriented Programming with PHP 5


Community Events











Don't see your event here?
Let us know!


database package mysql zend example security PEAR zendframework PHP5 cakephp conference application developer book ajax code framework releases job release

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework