PMA\libraries\Template::render PHP Method

render() public method

Render template
public render ( array $data = [], array $helperFunctions = [] ) : string
$data array Variables to be provided to the template
$helperFunctions array Helper functions to be used by template
return string
    public function render($data = array(), $helperFunctions = array())
    {
        $template = static::BASE_PATH . $this->name . '.phtml';
        try {
            $this->set($data);
            $this->helperFunctions = array_merge($this->helperFunctions, $helperFunctions);
            extract($this->data);
            ob_start();
            if (file_exists($template)) {
                include $template;
            } else {
                throw new \LogicException('The template "' . $template . '" not found.');
            }
            $content = ob_get_clean();
            return $content;
        } catch (\LogicException $e) {
            ob_end_clean();
            throw new \LogicException($e->getMessage());
        }
    }