public function render(string $view = '', array $variables = []): string
    {
        if (!empty($view)) {
            $this->setView($view);
        }
        $this->assign($variables);
        $content = $this->renderView();
        if (empty($this->layout)) {
            return $content;
        }
        return $this->renderLayout($content);
    }
public function render(string $view = '', array $variables = []): string
    {
        if (!empty($view)) {
            $this->setView($view);
        }
        $this->assign($variables);
        $content = $this->renderView();
        if (empty($this->layout)) {
            return $content;
        }
        return $this->renderLayout($content);
    }
public function render ( string $ view = '' , array $ variables = [ ] ) : string { if ( ! empty ( $ view ) ) { $ this -> setView ( $ view ) ; } $ this -> assign ( $ variables ) ; $ content = $ this -> renderView ( ) ; if ( empty ( $ this -> layout ) ) { return $ content ; } return $ this -> renderLayout ( $ content ) ; }
Renders given view and returns html code.

@param string $view
@param array $variables
@throws TemplatingException
@return string
Renders given view and returns html code .