implements Phalcon\Events\EventsAwareInterface
This component helps to load your project classes automatically based on some conventions
use Phalcon\Loader; // Creates the autoloader $loader = new Loader(); // Register some namespaces $loader->registerNamespaces( [ "Example\\Base" => "vendor/example/base/", "Example\\Adapter" => "vendor/example/adapter/", "Example" => "vendor/example/", ] ); // Register autoloader $loader->register(); // Requiring this class will automatically include file vendor/example/adapter/Some.php $adapter = new \Example\Adapter\Some();
Sets the events manager
Returns the internal event manager
Sets an array of file extensions that the loader must try in each attempt to locate the file
Returns the file extensions registered in the loader
Register namespaces and their related directories
...
Returns the namespaces currently registered in the autoloader
Register directories in which “not found” classes could be found
Returns the directories currently registered in the autoloader
Registers files that are “non-classes” hence need a “require”. This is very useful for including files that only have functions
Returns the files currently registered in the autoloader
Register classes and their locations
Returns the class-map currently registered in the autoloader
Register the autoload method
Unregister the autoload method
Checks if a file exists and then adds the file by doing virtual require
Autoloads the registered classes
Get the path when a class was found
Get the path the loader is checking for a path
© 2011–2017 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/latest/api/Phalcon_Loader.html