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.
Resource loader
string $_basePath = ''
Detailsarray $_components = 'array'
Detailsstring $_defaultResourceType = ''
Detailsstring $_namespace = ''
Detailsarray $_resourceTypes = 'array'
Details__call(
string $method, array $args
)
:
mixedOverloading: methods
Allow retrieving concrete resource object instances using 'get
$loader = new Zend_Loader_Autoloader_Resource(array(
'namespace' => 'Stuff_',
'basePath' => '/path/to/some/stuff',
))
$loader->addResourceType('Model', 'models', 'Model');
$foo = $loader->getModel('Foo'); // get instance of Stuff_Model_Foo class
Details__construct(
array|Zend_Config $options
)
:
voidConstructor
DetailsaddResourceType(
string $type, string $path, null|string $namespace
=
null
)
:
Zend_Loader_Autoloader_ResourceAdd resource type
DetailsaddResourceTypes(
array $types
)
:
Zend_Loader_Autoloader_ResourceAdd multiple resources at once
$types should be an associative array of resource type => specification pairs. Each specification should be an associative array containing minimally the 'path' key (specifying the path relative to the resource base path) and optionally the 'namespace' key (indicating the subcomponent namespace to append to the resource namespace).
As an example:
$loader->addResourceTypes(array(
'model' => array(
'path' => 'models',
'namespace' => 'Model',
),
'form' => array(
'path' => 'forms',
'namespace' => 'Form',
),
));
Detailsautoload(
string $class
)
:
mixedAttempt to autoload a class
DetailsclearResourceTypes(
)
:
Zend_Loader_Autoloader_ResourceClear all resource types
DetailsgetBasePath(
)
:
stringGet base path to this set of resources
DetailsgetClassPath(
string $class
)
:
FalseHelper method to calculate the correct class path
DetailsgetDefaultResourceType(
)
:
string|nullGet default resource type to use when calling load()
DetailsgetNamespace(
)
:
stringGet namespace this autoloader handles
DetailsgetResourceTypes(
)
:
arrayRetrieve resource type mappings
DetailshasResourceType(
string $type
)
:
boolIs the requested resource type defined?
Detailsload(
string $resource, string $type
=
null
)
:
objectObject registry and factory
Loads the requested resource of type $type (or uses the default resource type if none provided). If the resource has been loaded previously, returns the previous instance; otherwise, instantiates it.
DetailsremoveResourceType(
string $type
)
:
Zend_Loader_Autoloader_ResourceRemove the requested resource type
DetailssetBasePath(
string $path
)
:
Zend_Loader_Autoloader_ResourceSet base path for this set of resources
DetailssetDefaultResourceType(
string $type
)
:
Zend_Loader_Autoloader_ResourceSet default resource type to use when calling load()
DetailssetNamespace(
string $namespace
)
:
Zend_Loader_Autoloader_ResourceSet namespace that this autoloader handles
DetailssetOptions(
array $options
)
:
Zend_Loader_Autoloader_ResourceSet class state from options
DetailssetResourceTypes(
array $types
)
:
Zend_Loader_Autoloader_ResourceOverwrite existing and set multiple resource types at once
Details