implementation of auto loading modifiers

Первая попытка создание автозагрузки модифкаторов.
This commit is contained in:
Maxim Kostjukevich 2013-07-20 12:17:20 +03:00
parent ce8f0201cc
commit 98d4ead070
2 changed files with 11 additions and 1 deletions

View File

@ -460,7 +460,12 @@ class Fenom {
return $this->_modifiers[$modifier];
} elseif($this->isAllowedFunction($modifier)) {
return $modifier;
} else {
}
$path = __DIR__ . DIRECTORY_SEPARATOR . 'plugins'. DIRECTORY_SEPARATOR . 'modifier_'. $modifier . '.php';
if (is_file($path) && is_readable($path)) {
require_once $path;
return 'modifier_'. $modifier;
} else {
throw new \Exception("Modifier $modifier not found");
}
}

View File

@ -0,0 +1,5 @@
<?php
function modifier_red($text) {
return '<span style="color:red;">'.$text.'</span>';
}
?>