Gems specific version of the snippet loader
Loads snippets like all other classes in gems first with project prefix, then gems, mutil and when all that fails it will try without prefix from the project\snippets and gems\snippets folders
| package | Gems |
|---|---|
| subpackage | Snippets |
| copyright | Copyright (c) 2011 Erasmus MC |
| license | New BSD License |
| since | Class available since version 1.5.5 |
| inherited_from | \Gems_Loader_TargetLoaderAbstract |
__construct(mixed $source= null, array $dirs= array())
mixedSomething that is or can be made into \MUtil_Registry_SourceInterface, otherwise \Zend_Registry is used.
arrayprefix => pathname The inital paths to load from
__construct(mixed $container, array $dirs)
mixedA container acting as source for \MUtil_Registry_Source
arrayThe directories where to look for requested classes
__get($name)
addPrefixPath(string $prefix, string $path, boolean $prepend = true) : \MUtil_Snippets_SnippetLoaderInterface
string
string
boolean
\MUtil_Snippets_SnippetLoaderInterfaceaddPrefixPath(string $prefix, $path, boolean $prepend = true) : \Gems_Loader_LoaderAbstract
string
booleanPut path at the beginning of the stack (has no effect when prefix / dir already set)
\Gems_Loader_LoaderAbstract(continuation pattern)afterRegistry() : void
answerRegistryRequest(string $name, mixed $resource) : boolean
stringName of resource to set
mixedThe resource.
booleanTrue if $resource was OKcheckRegistryRequestsAnswers() : boolean
booleanFalse if required values are missing.getRegistryRequests() : array
Returns those object variables defined by the subclass but not at the level of this definition.
Can be overruled.
arrayof string namesgetSnippet(string $filename, array $extraSourceParameters = null) : \MUtil_Snippets_SnippetInterface
stringThe name of the snippet
arrayname/value pairs to add to the source for this snippet
\MUtil_Snippets_SnippetInterfaceThe snippetgetSource() : \MUtil_Registry_SourceInterface
\MUtil_Registry_SourceInterfaceremovePrefixPath(string $prefix, string $path = null) : \MUtil_Snippets_SnippetLoaderInterface
string
stringOPTIONAL
\MUtil_Snippets_SnippetLoaderInterfacesetSource(\MUtil_Registry_SourceInterface $source) : \MUtil_Snippets_SnippetLoader
\MUtil_Registry_SourceInterface
\MUtil_Snippets_SnippetLoader(continuation pattern)_cascadedDirs(array $dirs, string $cascade, boolean $fullClassnameFallback = true) : array
arrayprefix => path
stringThe sub directories to cascade to
booleanAllows full class name specification instead of just plugin name part
arrayprefix => path_getClass(string $name, string $className= null, array $arguments= array()) : mixed
stringThe $name of the variable to store this object in.
stringClass name or null if the same as $name, prepending $this->_dirs.
arrayClass initialization arguments.
mixedInstance of $className_loadClass(string $name, boolean $create= false, array $arguments= array()) : mixed
filterRequestNames(string $name) : boolean
Can be overriden.
string
boolean$verbose : boolean
falseSometimes it is hard to find out what snippets will be loaded. Use the verbose option to see what snippets are requested and what the resulting snippet is including the full prefix (if any).
Use: \Gems_Snippets_SnippetLoader::$verbose = true; to enable.
$_dirs : array
The standard value is
But an alternative could be:
$_loader : \MUtil_Loader_PluginLoader
$cascade : string
'Snippets'$cascade : string
null