src/Base/Widget.php
public function render($viewName, $params = [], $view = null)
    {
        if ($view !== null) {
            $this->setView($view);
        }
        return $this->getView()->render($viewName, $params, $this);
    }
public function render($viewName, $params = [], $view = null)
    {
        if ($view !== null) {
            $this->setView($view);
        }
        return $this->getView()->render($viewName, $params, $this);
    }
Renders a view.

The view to be rendered can be specified in one of the following formats:

- [path alias](guide:concept-aliases) (e.g. "@app/views/site/index");
- absolute path within application (e.g. "//site/index"): the view name starts with double slashes.
The actual view file will be looked for under the [[Application::viewPath|view path]] of the application.
- absolute path within module (e.g. "/site/index"): the view name starts with a single slash.
The actual view file will be looked for under the [[Module::viewPath|view path]] of the currently
active module.
- relative path (e.g. "index"): the actual view file will be looked for under [[viewPath]].

If the view name does not contain a file extension, it will use the default one `.php`.

@param string                 $viewName the view name.
@param array                  $params the parameters (name-value pairs) that should be made available in the view.
@param Reaction\Web\View|null $view
@return string the rendering result.
@throws InvalidArgumentException if the view file does not exist.