mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 09:54:27 +02:00
Fix testRegisterCompilerFunction by parsing argument correctly.
This commit is contained in:
@@ -6,6 +6,14 @@ use Smarty\Compile\Base;
|
|||||||
|
|
||||||
class BCPluginWrapper extends Base {
|
class BCPluginWrapper extends Base {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attribute definition: Overwrites base class.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @see Smarty_Internal_CompileBase
|
||||||
|
*/
|
||||||
|
public $optional_attributes = array('_any');
|
||||||
|
|
||||||
private $callback;
|
private $callback;
|
||||||
|
|
||||||
public function __construct($callback, bool $cacheable = true) {
|
public function __construct($callback, bool $cacheable = true) {
|
||||||
@@ -17,6 +25,6 @@ class BCPluginWrapper extends Base {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) {
|
public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) {
|
||||||
return call_user_func($this->callback, $args, $compiler->getSmarty());
|
return call_user_func($this->callback, $this->getAttributes($compiler, $args), $compiler->getSmarty());
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user