Bootstrap\View\Helper\BootstrapFormHelper::_wrapTemplates PHP Метод

_wrapTemplates() защищенный Метод

Replace the templates with the ones specified by newTemplates, call the specified function with the specified parameters, and then restore the old templates.
protected _wrapTemplates ( $templates, $callback, $params ) : The
Результат The return value of $callback
    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;
    }