This renders the view file, you can pass in an array or object for $data

@param $file
@param $data
@return string
437875
public function render($file, $data) {
        $template = $this->engine->loadTemplate($file);

        return $template->render($data);
    }
539387
private function loadView($file, $data = array(), $return = FALSE)
    {
        ob_start();
        if (file_exists($file) || file_exists(PUBLIC_DIR . $file))
        {
            # Preventing $data of this method to be passed to view.
            $__data = $data;
            unset($data);

            # Merging with already added data to class property.
            $___data = array_merge($this->view_data, $__data);

            if ($this->is_smarty)
            {
                $this->enableSmarty();
                foreach ($___data as $key => $value)
                {
                    $this->smarty->assign($key, $value);
                }
                $this->smarty->display($file);
            }
            else
            {
                extract($___data);

                # Now we don't want __data and ___data.
                unset($__data, $___data);

                include $file;
            }
        }

        # Setting flag off.
        $this->is_smarty = FALSE;

        # Returning view if requested to return.
        if ($return === TRUE)
        {
            $content = ob_get_contents();
            ob_end_clean();
            return $content;
        }
    }
1240369
public function load($file, $data = null)
    {
        $data = array_merge($this->data, (array) $data);

        $renderer = $this->createSelf();

        return $renderer->render($file, $data);
    }
450178
public function load($file, array $data = array())
    {
        $this->queries = array();
        $this->data = $data;

        include $file;

        return $this;
    }
968995
public static function write(String $file, String $data) : Int
    {
        return file_put_contents(Info::rpath($file), $data);
    }
1324425
protected function getViewFile($file)
	{
		if($this->useRuntimePath)
		{
			$crc=sprintf('%x', crc32(get_class($this).Yii::getVersion().dirname($file)));
			$viewFile=Yii::app()->getRuntimePath().DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.$crc.DIRECTORY_SEPARATOR.basename($file);
			if(!is_file($viewFile))
				@mkdir(dirname($viewFile),$this->filePermission,true);
			return $viewFile;
		}
		else
			return $file.'c';
	}
437249
public function renderFile($file)
    {
        if (!is_file($file)) {
            throw new \RuntimeException(sprintf('View cannot render file "%s" does not exist', $file));
        }

        ob_start();
        ob_implicit_flush(false);

        require $file;
        return ob_get_clean();
    }
842289
public function getView($filename, $data = null)
    {
        // $data = ($data === null) ? $this->_data : $data;
        return $this->getTemplateFile($this->getTemplateFolder().$filename, $data);
    }
813304
protected function viewImage($file, $controller)
    {
        $path = $file->getRealPath();

        $data = array(
            'file' => $file,
            'src' => $controller->image(gplcart_file_relative($path)),
            'exif' => function_exists('exif_read_data') ? exif_read_data($path) : array()
        );

        return $controller->render('file_manager|readers/image', $data);
    }
209695
public function loadFile($file)
    {
        if (!file_exists($file)) {
            throw new LoaderException("Requested file '{$file}' doesn't exist");
        }

        $data = include($file);

        if (!is_array($data)) {
            throw new LoaderException("Requested file '{$file}' is expected to return an array");
        }

        return $data;
    }
945361
protected function view($file, $param=array()) {
		extract($param);
		
		if (!is_array($file)) {
			$path =  explode('\\', get_class($this));

			if (count($path) > 2) {
				$view_path = '';

				for($i=0; $i<count($path)-2; $i++) {
					$view_path .= strtolower($path[$i]).'/';
				}	

				$view_path = Config::get('path.mvc').'/'.$view_path;
			} else {
				$view_path = Config::get('path.mvc');
			}

			if (php_sapi_name() == 'cli')
				$view_path = Config::get('path.basepath').'/'.$view_path;
		} else {
			
			$view_path = Config::get('path.mvc');
			if (isset($file[1])) {
				$view_path .= '/'.$file[0];
				$file = $file[1];
			} else
				$file = $file[0];

			if (php_sapi_name() == 'cli')
				$view_path = Config::get('path.basepath').'/'.$view_path; 
			
		}
		
		ob_start();
			include $view_path.'/views/'.$file.'.php';
		return ob_get_clean();
	}
1048152
protected function _render(string $viewFile, array $data = []): string
    {
        if (empty($data)) {
            $data = $this->viewVars;
        }

        if (substr($viewFile, -3) === 'php') {
            $out = parent::_render($viewFile, $data);
        } else {
            $data = array_merge(
                $data,
                iterator_to_array($this->helpers()->getIterator()),
                [
                    '_view' => $this,
                ]
            );

            try {
                $out = $this->getTwig()->loadTemplate($viewFile)->render($data);
            } catch (Exception $e) {
                $previous = $e->getPrevious();

                if ($previous !== null && $previous instanceof Exception) {
                    throw $previous;
                } else {
                    throw $e;
                }
            }
        }

        return $out;
    }
990425
private static function parse($file, $data)
    {
        $file = file_get_contents($file, FILE_USE_INCLUDE_PATH);

        // Go through each variable and replace the values
        foreach($data as $key => $value)
        {
            $pattern = '{{{' . $key . '}}}';
            $file = preg_replace($pattern, $value, $file);
        }

        if(!!$file)
        {
            return $file;
        }

        return false;
    }
613669
protected function render(array $data = [], $file = null) : Response
    {
        if ($file === null) {
            $file = $this->getTemplateFile();
        }

        // Relative path from the controller?
        if (substr($file, 0, 1) !== '/') {
            $file = $this->getTemplateFile($file);
        }

        $data += [
            'base_url' => 'http://' . $this->request->getHost(),
            '_messages' => $this->messages,
        ];
        $this->messages = [];

        return new Response($this->renderView($file, $data));
    }
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);
    }
846172
public function render(string $view, array $data = []): string
    {
        return $this->native()->render(
            $this->path($view),
            $data
        );
    }
1298581
private function getContent($file, $data = [])
    {
        $path = fixPath($file);
        if (file_exists($path)) {
            ob_start();
            //Extract variables
            extract($data);

            /** @noinspection PhpIncludeInspection */
            require $path;

            return ob_get_clean();
        } else {
            throw new Exception("View $path not found");
        }
    }