Smarty v5 update test, initial code setup
This commit is contained in:
19
src/BlockHandler/BlockPluginWrapper.php
Normal file
19
src/BlockHandler/BlockPluginWrapper.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Smarty\BlockHandler;
|
||||
|
||||
use Smarty\Template;
|
||||
|
||||
class BlockPluginWrapper extends Base {
|
||||
|
||||
private $callback;
|
||||
|
||||
public function __construct($callback, bool $cacheable = true) {
|
||||
$this->callback = $callback;
|
||||
$this->cacheable = $cacheable;
|
||||
}
|
||||
|
||||
public function handle($params, $content, Template $template, &$repeat) {
|
||||
return call_user_func_array($this->callback, [$params, $content, &$template, &$repeat]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user