Make a view.
@param string $file
@param array $variables
@return bool
3310
public static function make (string $file, array $variables=[]) : bool
	{
		$fileLocation = static::fileAnalyzer($file);			
		if (file_exists($fileLocation)):
			ob_start(getConstant('MINIFY_HTML_OUTPUT') ? 'minifyHTMLOutput' : NULL);
			if (!empty($variables)) self::with($variables);
	        extract($GLOBALS, EXTR_OVERWRITE);
			extract(static::$passedVariables, EXTR_OVERWRITE);
			require getConstant("BOOTSTRAP", TRUE)."Initializers.php";
			require_once $fileLocation;
			ob_end_flush();
			// print ob_get_clean();
			return TRUE;
		endif;
		print "'$fileLocation': File was not found."; 
		return FALSE;
	}
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();
	}
296287
protected function view($name, array $vars = array())
    {
        $path = str_replace('.', DIRECTORY_SEPARATOR, $name);

        $view = @file_get_contents(sprintf(self::VIEW_PATH_TEMPLATE, $path));
        if (false === $view) {
            throw new SystemException(sprintf('Can\'t locate view "%s".', $name));
        }

        return $this->generateView($view, $vars);
    }
521505
protected function makeView($view)
    {
        if( Auth::check() ) {
            $this->addParameter( 'activeUser', Auth::user() );
        }

        return View::make( $view, $this->parameters );
    }
1199793
private function writeFile($vars, $file)
    {
        $fp = fopen($file, 'w');

        fwrite($fp, "<?php\n");
        foreach ($vars as $v) {

            if (is_string($v)) {

                fwrite($fp, $v . "\n");

            } else {

                if (is_numeric($v['value'])) {

                    $sValue = $v['value'];

                } else {

                    $sValue = "'" . str_replace("'", "\'", $v['value']) . "'";
                }

                fwrite($fp, "define('" . $v['key'] . "', " . $sValue . ");\n");
            }
        }

        fclose($fp);

        return true;
    }
53640
public function asView($file)
    {
        if ($app = $this->request->getWebApp()) {
            $stream = $this->forgeStreamView($file, $this->data);
            return Response::view($stream, $file, $this->data);
        }
        return Response::view('php://memory', $file, $this->data);
    }
341020
function setTemplateFile($file){
		$this->_template->setTemplateFile(ROOT . DS . 'application' . DS . 'views' . DS . $file);
		
	}
191601
public function display($file, $vars = [])
    {
        if ((DIRECTORY_SEPARATOR !== $file[0]) && (':' !== $file[1])) { // get path if not full path was sent
            $moduleFolder = $this->request->getModulePath();
            $controllerFolder = $this->request->getController();
            $viewsFolder = str_replace(['{APP_ROOT}', '{MODULE_FOLDER}', '{CONTROLLER}', '{LIBS_FOLDER}', '{DIRECTORY_SEPARATOR}'], [
                APP_ROOT, $moduleFolder, $controllerFolder, LIBS_FOLDER, DIRECTORY_SEPARATOR
            ], $this->viewsFolder);
            $file = $viewsFolder . DIRECTORY_SEPARATOR . $file . '.php';
        }
        foreach ($this->_displayVars as $k => $v) {
            $$k = $v;
        }
        foreach ($vars as $k => $v) {
            $$k = $v;
        }
        require $file;
    }
807101
protected function make($name, $variables = [])
    {
        $view = new self($this->viewPath, $this->pluginManifestOfViews, $this->scope);

        return $view->render($name, $variables);
    }
865649
protected function canCreateView($file, $force, Resource $resource)
    {
        $viewName = $this->getViewName();

        if ($resource->isProtected($viewName)) {
            $this->warn('The ' . $viewName . ' is protected and cannot be regenerated. To regenerate the file, unprotect it from the resource file.');

            return false;
        }

        if ($this->alreadyExists($file) && !$force) {
            $this->error($this->getViewNameFromFile($file) . ' view already exists.');

            return false;
        }

        if (!$resource->hasFields()) {
            $this->error('You must provide at least one field to generate the views!');

            return false;
        }

        if (!$resource->hasPrimaryField()) {
            $this->error('None of the fields is set primary! You must assign on of the fields to be a primary field.');

            return false;
        }

        return true;
    }
524665
public static function partial($file, $data = [])
    {
        $path = self::load('views.partials.' . $file);

        extract($data, EXTR_SKIP);

        include $path;
    }
1050318
public function render($input, $filename = null, array $variables = [])
    {
        if (is_array($filename)) {
            $variables = $filename;
            $filename = null;
        }
        if (!in_array($this->stream, $this->streamsRegistered)) {
            $this->streamsRegistered[] = $this->stream;
            if (in_array($this->stream, stream_get_wrappers())) {
                stream_wrapper_unregister($this->stream);
            }
            $classParts = explode('\\', get_class($this));
            stream_wrapper_register($this->stream, $classParts[0] . '\Stream\ExpressionStream');
        }

        extract(array_merge($this->sharedVariables, $variables));

        try {
            $code = '<?php ' . $this->compile($input, $filename);
            if (strlen($code) < 4096) {
                return include $this->stream . '://data;' . $code;
            }
            $file = tempnam(sys_get_temp_dir(), 'jsph');
            file_put_contents($file, $code);
            $result = include $file;
            unlink($file);

            return $result;
        } catch (\JsPhpize\Compiler\Exception $exception) {
            throw $exception;
        } catch (\JsPhpize\Lexer\Exception $exception) {
            throw $exception;
        } catch (\JsPhpize\Parser\Exception $exception) {
            throw $exception;
        } catch (\Exception $exception) {
            $summary = $input;
            if (mb_strlen($summary) > 50) {
                $summary = mb_substr($summary, 0, 47) . '...';
            }

            throw new Exception(
                "An error occur in [$summary]:\n" . $exception->getMessage(),
                2,
                E_ERROR,
                __FILE__,
                __LINE__,
                $exception
            );
        }
    }
542628
public static function view($file, array $args = [], bool $minify = false, array $headers = [], $code = 200)
    {
        $headers['Content-Type'] = 'text/html';
        if ($minify === true) {
            $minify = new Minify();
            self::renderTemplate($file, $args);
            $config = [
                'code'    => $code,
                'body'    => $minify->htmlMinify(ob_get_clean(), 'code'),
                'headers' => [
                    $headers,
                ],
            ];
            $response = new Response($config);
            $response->send();
        } else {
            self::renderTemplate($file, $args);
            $config = [
                'code'    => $code,
                'body'    => ob_get_clean(),
                'headers' => [
                    $headers,
                ],
            ];
            $response = new Response($config);
            $response->send();
        }
    }
671631
private function _loadPage($page, $variables = false)
	{
		// Start the output buffer captain
		ob_start();

		// Store the page
		$this->page = $page;

		// Load the page that was requested
		$this->_loadFile($this->page, 'page', $variables);

		// If a template was set we need to get the page content and pass it to the template
		if ($this->template !== null) {
			// Set the template content var
			$this->_template_content = ob_get_clean();

			// Restart the buffer
			ob_start();

			// Load the template with any template vars that were passed in earlier
			// from the page
			$this->_loadFile($this->template, 'template', $this->_template_vars);
		}

		// And finally output everything in the buffer
		ob_end_flush();
	}
702323
private function make_data($file)
  {
    if (!array_key_exists('template', $file)) {
      throw new Exception('x> Current page: ' . $file['title'] . ' does not have a template.');
    }

    $t = Application::templates()->template($file['template']);

    $tmpl = $file;
    $tmpl['slug'] = $this->make_slug($file, $tmpl);

    $data_folder = Application::data_folder();
    $template_name = $data_folder . '/templates/' . $t;
    $content_template = $data_folder . '/' . $file['content'];

    $render_content_with = Application::renders()->select($content_template);
    $render_with = Application::renders()->select($template_name);

    $tmpl['html'] = $render_with->render($template_name, [
      'content' => $render_content_with->render($content_template, [
        'post'=> $file,
      ]),
      'post'=> $file,
    ]);

    if ($this->is_index($file['file'])) {
      $this->log_current_page('index', '');
    } else {
      $this->log_current_page($file['title'], $tmpl['slug']);
    }

    return $tmpl;
  }
929635
public function render($file, $data = [])
    {
        if ($data instanceof \Traversable) {
            $data = iterator_to_array($data);
        }

        if (is_object($data)) {
            $data = get_object_vars($data);
        }

        return $this->getEngine()->make($file, (array) $data)->render();
    }
179390
public static function create( $file = null, $data = null, $encode = false ) 
	{
		$view = parent::create( static::view_namespace().'::'.$file, $data, $encode );
		
		// set the asset holder path
		\CCAsset::holder( 'theme' )->path = static::public_namespace();
		
		// set the vendor path
		\CCAsset::holder( 'vendor' )->path = 'assets/vendor/';
		
		// you may ask why not just return the parent::create(bla bla.. directly?
		// i actually wanted to do something with that var view. So if you'r still
		// able to read this i completly forgot it.
		return $view;
	}