protected function _wrapTemplates($templates, $callback, $params)
{
$oldTemplates = array_map([$this, 'templates'], array_combine(array_keys($templates), array_keys($templates)));
$this->templates($templates);
$result = call_user_func_array($callback, $params);
$this->templates($oldTemplates);
return $result;
}