Hello,
why $callback can use only anonymous function?
callback must support various ways(because he is callback :) ), like ['class','method'], plain function name. Now only works anonymous function.
<?php
// now it works!
function getTemplate($controller, $action, $params = [], $callback = null) {
$inner = null;
if (is_callable($callback)) {
$inner = function (\Phalcon\Mvc\View $view) use ($callback) {
call_user_func_array($callback, [$view]);
};
}
return $this->view->getRender($controller, $action, $params, $inner);
}