Learn courses for free
Publish new courses and earn
Check your skills
Improve your skillsets for free
 
or
    
learnNpublish-PHP Auto Loading Classes
PHP Auto Loading Classes [ Share ] [ Register To Take Test ]
Few days ago my friend Mark, added on my blog interesting comment regarding autoloading objects in PHP. While i think it is great to have quality comments like each of Mark’s comment, autoloading is a topic that requires a separate post.

What is autoloading? Every time you want to use a new class in your PHP project, first you need to include this class (using include or require language construct, that’s right this are not functions). However if you have __autoload function defined, inclusion will handle itself.
Author: Kasi Rajan Aggregator: Kasi
Type: Free Points Required: 0     Comments (0)
Uploaded Files
About PHP auto loading classes
php.txt
Referral Links
Let s look at the two examples below, both of them work exactly the same way. However, in first one we do not have autoload function defined, thus we need to include class definition manually, in second example new class is automatically loaded when it is first used.
http://ditio.net/2008/11/13/php-autoload-best-practices/
Lectures

Advanced PHP   Auto Loading Classes with Namespaces

Add Tags
Post a Comment: