Autoloads Twig classes.
More...
Autoloads Twig classes.
- Author
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
- Deprecated:
- since 1.21 and will be removed in 2.0. Use Composer instead. 2.0.
Definition at line 21 of file Autoloader.php.
◆ autoload()
static Twig_Autoloader::autoload |
( |
|
$class | ) |
|
|
static |
Handles autoloading of classes.
- Parameters
-
Definition at line 44 of file Autoloader.php.
References $file, and array.
46 if (0 !== strpos($class,
'Twig')) {
50 if (is_file(
$file = dirname(__FILE__).
'/../'.str_replace(
array(
'_',
"\0"),
array(
'/',
''), $class).
'.php')) {
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ register()
static Twig_Autoloader::register |
( |
|
$prepend = false | ) |
|
|
static |
Registers Twig_Autoloader as an SPL autoloader.
- Parameters
-
bool | $prepend | whether to prepend the autoloader or not |
Definition at line 28 of file Autoloader.php.
References array.
30 @trigger_error(
'Using Twig_Autoloader is deprecated since version 1.21. Use Composer instead.', E_USER_DEPRECATED);
32 if (PHP_VERSION_ID < 50300) {
33 spl_autoload_register(
array(__CLASS__,
'autoload'));
35 spl_autoload_register(
array(__CLASS__,
'autoload'),
true, $prepend);
Create styles array
The data for the language used.
The documentation for this class was generated from the following file: