mirror of
https://github.com/flextype/flextype.git
synced 2025-08-07 21:56:33 +02:00
feat(directives): small update for calc directive
This commit is contained in:
@@ -28,7 +28,7 @@ emitter()->addListener('onEntriesFetchSingleField', static function (): void {
|
||||
$result = entries()->registry()->get('methods.fetch.result');
|
||||
|
||||
if (is_string($field['value'])) {
|
||||
$field['value'] = preg_replace_callback('/@calc\[(.*?)\]/s', function($matches) use ($result) {
|
||||
$field['value'] = preg_replace_callback('/@calc\[(.*?)\]/s', function($matches) {
|
||||
return (new StringCalc())->calculate($matches[1]);
|
||||
}, $field['value']);
|
||||
}
|
||||
|
Reference in New Issue
Block a user