4.5. Opl_Loader class
4.5.7. map()
4.5.6. loadPaths()
« Previous
4.5.8. mapAbsolute()
Next »

4.5.7. map()

ConstructStatic method
Visibilitypublic
Referencevoid Opl_Loader::map( string $className, string $file )
Argument list
$className - string
The class name to map.
$file - string
The file with the class.
Versionssince 2.0.0-dev7

Allows to specify the path to the class $className manually within its library directory.

Opl_Loader::setDirectory('../libs/');
Opl_Loader::map('Opx_Some_Class', 'Sth/Else/Somefile.php');
 
// Loads this class from `../libs/Opx/Sth/Else/Somefile.php`
$obj = new Opx_Some_Class;

To specify an absolute path, use Opl_Loader::mapAbsolute().

See also:

4.5.7. map()
4.5. Opl_Loader class
« Previous
4.5.6. loadPaths()
Next »
4.5.8. mapAbsolute()