@param            $viewPath
@param array|null $data

@return string
@throws ViewNotFoundException
197478
public function renderView($viewPath, array $data = null)
    {
        $this->setView($viewPath);

        !$data or extract($data);
        ob_start();

        if (file_exists(rtrim(
                $this->getViewPath(), $this->getFileExt()
            ) . $this->getFileExt())) {

            /** @noinspection PhpIncludeInspection */
            include rtrim(
                    $this->getViewPath(), $this->getFileExt()
                ) . $this->getFileExt();

        } elseif (file_exists(rtrim(
                $this->getViewFallbackPath(), $this->getFileExt()
            ) . $this->getFileExt())) {

            /** @noinspection PhpIncludeInspection */
            include rtrim(
                    $this->getViewFallbackPath(), $this->getFileExt()
                ) . $this->getFileExt();

        } else {
            throw new ViewNotFoundException('View ' . rtrim(
                    $this->getViewPath(), $this->getFileExt()
                ) . $this->getFileExt() . ' not found');
        }

        $rendered = ob_get_contents();
        ob_end_clean();

        return $rendered;
    }
945529
public function render(View $template, array $data = array())
    {
        if (! empty($this->data)) {
            $data = array_merge($this->data, $data);
        }

        // Load file into string
        $source = file_get_contents($template->getFullPath());

        if ($source === false) {
            throw new FileNotFoundException("View file '" . $template->getFullPath() . "' is not found!"); // @codeCoverageIgnore
        }

        return $this->environment->render($template->getPath(), $data);
    }
752218
public function makeView($filePath, $templatePath, $data)
    {
        if(!file_exists(resource_path($filePath)))
        {
            $view =  View::file($templatePath, $data);
            file_put_contents(resource_path($filePath), str_replace(["<%", "%>", "#", "*"], ["{{", "}}", "@", "$"], $view->render()));
        }else{
            if($this->mode == "overwrite")
            {
                $view =  View::file($templatePath, $data);
                file_put_contents(resource_path($filePath), str_replace(["<%", "%>", "#", "*"], ["{{", "}}", "@", "$"], $view->render()));
            }
        }
    }
838976
public function renderTemplate($templatePath = null, $data = [])
    {
        $templateData = $this->readTemplate($templatePath);
        if($data === null) {
            throw new Exception("template(): expects parameter 2 to be array, null given");
        }
        foreach($data as $key => $val) {
            if(is_array($val)) {
                $findStart = strpos($templateData, '{{'.$key.':}}');
                if($findStart !== false) {
                    $findEnd = strpos($templateData, '{{:'.$key.'}}');
                    if($findEnd !== false) {
                        $len = 5 + strlen($key);
                        $substr = substr($templateData, $findStart, ($findEnd - $findStart));
                        $substr = substr($substr, $len);
                        $loopstr = []; #fixed-for: Uncaught Error: [] operator not supported for strings $loopstr[]
                        foreach($val as $k => $v) {
                            $temp = $substr;
                            if(is_array($v)) {
                                //$temp = strtr($temp, $v); {{}} not replaced
                                foreach($v as $ks => $vs) {
                                    $temp = str_replace('{{'.$ks.'}}', $vs, $temp);
                                }
                            }
                            else {
                                $temp = str_replace('{{'.$key.'}}', $v, $temp);
                            }
                            $loopstr[] = $temp;
                        }
                        $loopstr = implode("\n", $loopstr);
                        $templateData = str_replace('{{'.$key.':}}'.$substr.'{{:'.$key.'}}', $loopstr, $templateData);
                    }
                    else {
                        throw new Exception('Error in template : loop has not closed properely');
                        exit;
                    }
                }
            }
            else {
                $templateData = str_replace('{{'.$key.'}}', $val, $templateData);
            }
        }
        return $templateData;
    }
408062
public function render(string $viewFile, array $viewData = []): string
    {
        return strtr(
            $viewFile,
            array_combine(
                array_map(
                    function ($key) {
                        return '{'.$key.'}';
                    },
                    array_keys($viewData)
                ),
                array_values($viewData)
            )
        );
    }
511149
public function render(object $controller, String $view, array $data = null): string
    {
        $this->dot = new IteratorDot($data);

        $this->data[] = (null === $data) ? array() : $data;
        $this->view = $view;
        $remove_namespace = explode('\\', get_class($controller));
        $this->controllers = $remove_namespace[2];
        extract($this->data);
        ob_start();
        $this->isHeader();
        include $this->file = DIR_FILE.'Views/'.$this->controllers.DS.$this->view.$this->ex;
        $this->isFooter();
        if (null === $this->layout) {
            ob_end_flush();
        } else {
            ob_end_clean();
            $this->include_file($this->layout);
        }
        $content = ob_get_contents();

        return $content;
    }
44030
public static function view(string $view = null, array $data = [], array $mergeData = []): Renderable
    {
        return view(self::NAME . '::' . $view, $data, $mergeData);
    }
782042
private function getRequireData($requestPath, array $getData = [])
    {
        $responseData = $this->get($requestPath, $getData);

        return self::requireNotNull($responseData);
    }
1313418
public function call($name, $data = null, $nest = null)
    {

        //Merge data
        if (!is_null($data)) {
            $this->data = array_merge($this->data, $data);
        }

        if (!$this->exists($name, $nest)) {
            throw new ViewNotFoundException($name);
        } else {
            $data = $this->exists($name, $nest);

            $this->path = $data['path'];
            $this->engine = $data['engine'];
            $this->nest = $nest;
        }

        $nameSegments = dot($name);

        $this->name = $this->setName($nameSegments);

        return $this;
    }
1063480
protected function viewContext($view_path)
    {
        // Pointer to NEW view data context
        $new = &$this->view_data[$view_path];

        // Pointer to OLD view data context
        $old = &$this->view_data[$this->view_context];

        // If we are trying to switch to NEW view context
        if ($this->view_context !== $view_path) {
            //elapsed( $this->id.' - Switching view context from '.$this->view_context.' to '.$view_path );

            // Create new entry in view data collection if it does not exists
            if (!isset($this->view_data[$view_path])) {
                // Create new view data record
                $new = array();

                // If current view data context has view data
                if (isset($old)) {
                    //elapsed($old);
                    //elapsed( $this->id.' - Copying previous view context view data '.$this->view_context.' to new view context '.$view_path.'('.sizeof($old).')');

                    // Copy default view context view data to new view context
                    $new = array_merge($new, $old);
                }

                // Clear plain HTML for new view context
                $new[self::VD_HTML] = '';
            }

            // Change view data pointer to appropriate view data entry
            $this->data = &$new;

            // Save current context name
            $this->view_context = $view_path;
        }
        //else elapsed( $this->id.' - NO need to switch view context from '.$this->view_context.' to '.$view_path );
    }
836380
public function manager($viewPath)
    {
        if (isset($this->managerByPath[$viewPath])) {
            return $this->managerByPath[$viewPath];
        }
        $this->managerByPath[$viewPath] = $this->createManagerForViewPath($viewPath);

        return $this->managerByPath[$viewPath];
    }
991876
public function getNode(NodePath $nodePath, array $data = null)
    {
        if (empty($data)) {
            $data = $this->data;
        }
        $nodePath = $nodePath->popFirst($nodeName);
        $nodeName = $this->encodeNodeName($nodeName);
        if (!isset($data[$nodeName])) {
            return null;
        }
        if ($nodePath->isEmpty()) {
            return $data[$nodeName];
        } else {
            return $this->getNode($nodePath, $data[$nodeName]);
        }
    }
711892
public function view(string $view, array $data = [])
  {
    $path = $this->viewsDirectory . $this->DS . $this->cleanPath($view) . $this->viewsExtension;
    $this->verify($path);
    $this->registerDirectives();

    $compiler = new Compiler($this->cacheDirectory, $this->viewsDirectory, $this->viewsExtension, $this->directives, $this->engine);
    $compiler->makeView($path, $data);
    return $this;
  }
79118
public function view($view, array $data = [], $mergeData = [])
    {
        $data['template'] = $this;

        if ($view instanceof View) {
            return $view->with($data);
        }

        return view($this->getViewPath($view), $data, $mergeData);
    }
407463
public function renderView($path, $data)
    {
        $obLevel = ob_get_level();
        ob_start();
        extract($data);

        /*
         | We will try to include view file and check content into try catch block
         | so that if any exception occurs output buffer will get flush out.
        */
        try {
            include $path;
        } catch (Exception $e) {
            $this->handleViewException($e, $obLevel);
        }

        return ltrim(ob_get_clean());
    }
703419
public function view($view, array $data = array())
    {
        $this->view = $view;

        $this->viewData = $data;

        return $this;
    }
35093
protected function view($view, $data = null, $module = null)
    {
        if ($data === null || !is_array($data)) {
            $data = $this->dis;
        }
        if ($module === null) {
            if (property_exists($this, 'module') && $this->module) {
                return view($this->module . '::' . $view, $data);
            }
        }
        return view($view, $data);
    }