How do Zend do it?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
Sadam
Forum Newbie
Posts: 5
Joined: Fri Jan 15, 2010 9:21 am

How do Zend do it?

Post by Sadam »

Hi, first post here.

I'm just wondering, how does the Zend framework sort of 'see' the classes before instantiates them? Obviously the file isn't included/required anywhere within the code, yet you can always create the object. Does anybody know?

Thanks,
(S)adam.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: How do Zend do it?

Post by Eran »

They use autoloading, which allows PHP to "magically" find those classes automatically.
http://php.net/manual/en/language.oop5.autoload.php
Sadam
Forum Newbie
Posts: 5
Joined: Fri Jan 15, 2010 9:21 am

Re: How do Zend do it?

Post by Sadam »

Ahh perfect, cheers!
Post Reply