Page 1 of 1

How do Zend do it?

Posted: Fri Jan 15, 2010 9:27 am
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.

Re: How do Zend do it?

Posted: Fri Jan 15, 2010 9:31 am
by Eran
They use autoloading, which allows PHP to "magically" find those classes automatically.
http://php.net/manual/en/language.oop5.autoload.php

Re: How do Zend do it?

Posted: Fri Jan 15, 2010 10:31 am
by Sadam
Ahh perfect, cheers!