- Fixed a bug within FunctionToken control structure where multiple definition were runned if a view was loaded more than once
This commit is contained in:
parent
fa815a506e
commit
3ffb69342b
@ -33,7 +33,9 @@ class FunctionToken implements ControlStructure {
|
||||
|
||||
protected function printFunction($context, ?string $arguments) : string
|
||||
{
|
||||
return "<?php function $arguments { ?>";
|
||||
$name = trim(explode('(', $arguments, 2)[0]);
|
||||
|
||||
return "<?php if (! function_exists(__NAMESPACE__ . '\\$name')) { function $arguments { ?>";
|
||||
}
|
||||
|
||||
protected function printReturn($context, ?string $arguments) : string
|
||||
@ -43,6 +45,6 @@ class FunctionToken implements ControlStructure {
|
||||
|
||||
protected function printEndFunction($context) : string
|
||||
{
|
||||
return "<?php } ?>";
|
||||
return "<?php } } ?>";
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user