Home » » spl_autoload_extensions

spl_autoload_extensions

Written By 1 on Monday, October 1, 2012 | 6:24 PM

string spl_autoload_extensions ([ string $file_extensions ] )
Register and return default file extensions for spl_autoload
This function can modify and check the file extensions that the built in __autoload() fallback function spl_autoload() will be using.
<?php
public function __construct()
{
spl_autoload_register(array($this,'library'));
}

public function library($class)
{
if (is_string($class) && null === $class) {
set_include_path(get_include_path().PATH_SEPARATOR.'app/lib/');
spl_autoload_extension('.php');
spl_autoload($class);
}
return false;
}
?>

0 Comment:

Post a Comment