Loader/SplAutoloader.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Loader
\Zend_Loader_SplAutoloader
Package: Zend_Loader
Returns
Defines an interface for classes that may register with the spl_autoload
registry
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Methods
__construct(null | array | \Traversable $options = null) : void
Constructor
Allow configuration of the autoloader via the constructor.
ParametersName | Type | Description |
---|---|---|
$options | null | array | \Traversable |
autoload( $class) : mixed
Autoload a class
Parameters
Returns
Name | Type | Description |
---|---|---|
$class |
Type | Description |
---|---|
mixed | False [if unable to load $class] get_class($class) [if $class is successfully loaded] |
register() : void
Register the autoloader with spl_autoload registry
Typically, the body of this will simply be:
spl_autoload_register(array($this, 'autoload'));
setOptions(array | \Traversable $options) : \SplAutoloader
Configure the autoloader
In most cases, $options should be either an associative array or
Traversable object.
ParametersName | Type | Description |
---|---|---|
$options | array | \Traversable |
Type | Description |
---|---|
\SplAutoloader |