Re: Is there any situation where anything other than require_once is better? [message #171928 is a reply to message #171923] |
Fri, 21 January 2011 17:19 |
Michael Fesser
Messages: 215 Registered: September 2010
Karma:
|
Senior Member |
|
|
.oO(Leonardo Azpurua)
> [require vs. require_once]
>
> But now I am going to start coding classes, and if they are going to
> be completely context independent, they must declare their own
> dependencies as "require" statements.
>
> And I guess "require_once" is the natural choice for this situation.
In case of classes there's another very convenient option: autoloading.
Have a look at __autoload() or better spl_autoload_register().
Micha
|
|
|