public function render(string $view, array $params = [], $return = false)
    {
        $params = array_merge($params, ['view' => $this]);
        /*
         * Check if template engine is set as true
         * then call template and return from here
         */
        if ($this->templateEngine !== false) {
            return $this->template($view, $params, $return);
        }

        $this->widgetName = $view;
        $this['__return_output__'] = $return;
        $this->__set('parameters', $params);
        $path = $this->getPath(Inflector::toDirectorySeparator($view));

        /*
         | Throw exception is view file is not readable
         */
        if (!file_exists($path) && !is_readable($path)) {
            throw new ViewNotFoundException("Requested view doesn't exists in path $path");
        }

        $this->registerViewEvent($view);
        $this->layout = Inflector::toDirectorySeparator($this->getLayout());

        if ($this->layout !== '') { // render view page into the layout
            $this->renderLayoutView($path, $this->getTwigViewPath().DS, $params)->displayContent();

            return $this;
        }

        $this->viewPath = $path;
        $this->load()->displayContent();

        return $this;
    }