mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
implementation of auto loading modifiers
Первая попытка создание автозагрузки модифкаторов.
This commit is contained in:
parent
ce8f0201cc
commit
98d4ead070
@ -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");
|
||||
}
|
||||
}
|
||||
|
5
src/plugins/modifier_red.php
Normal file
5
src/plugins/modifier_red.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
function modifier_red($text) {
|
||||
return '<span style="color:red;">'.$text.'</span>';
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue
Block a user