Returns a new View object. If you do not define the "file" parameter,
you must call [static::set_filename].

$view = View::forge($file);

@param   string  view filename
@param   array   array of values
@return  View
359336
public static function forge($file = null, $data = null, $auto_filter = null)
	{
		return new static($file, $data, $auto_filter);
	}
98468
protected function resolveFromCustomFilepath( $view ) {
		$directory = $this->getDirectory();

		if ( $directory === '' ) {
			return '';
		}

		// Normalize to ensure there are no doubled separators.
		$file = MixedType::normalizePath( $directory . DIRECTORY_SEPARATOR . $view );

		if ( ! file_exists( $file ) ) {
			// Try adding a .php extension.
			$file .= '.php';
		};

		return file_exists( $file ) ? $file : '';
	}
599645
public static function view($view, $variables = [])
    {
        extract($variables);

        ob_start();

        include dirname(dirname(__FILE__)).'/resources/views/'.$view.'.php';

        return ob_get_clean();
    }
326850
public function setView($view)
    {

        if (class_exists($view)) {
            //if we already have a default view
            $values = [];

            //grab all its parameters and store in parameters
            if (isset($this->view) && $this->view instanceof View) {

                $values = $this->view->getDataArray();
                $layout = $this->view->getLayout();

                //Load the newView;
                $this->view = $this->loadView($view, $values);

                if (!empty($layout)) {
                    $this->view->setLayout($layout);
                }
            }

            return $this;

        } else if (is_string($view)) {

            $this->response->addContent($view); //so that $this->view("Hi There");  will output Hi There;

            return $this;

        }

        return false; //no view set;
    }
280996
public function view($filename)
    {
        $serialized = false;

        if ($this->request->getQuery('as') === 'serialized') {
            $serialized = true;
            $this->viewBuilder()->setTemplate('view_as_serialized');
        }

        $content = $this->read($filename, $serialized);

        $this->set(compact('content', 'filename'));
    }
555098
public function setView($view)
    {
        $this->view = $view;

        $this->setDisplay(function ($model) {
            $this->data['model'] = $model;

            return view($this->getView(), $this->data);
        });

        return $this;
    }
291133
public function setView($view)
    {
        if(!($view instanceof KViewInterface))
        {
            if(is_string($view) && strpos($view, '.') === false )
            {
                $identifier			= $this->getIdentifier()->toArray();
                $identifier['path']	= array('view', $view);
                $identifier['name']	= $this->getRequest()->getFormat();

                $identifier = $this->getIdentifier($identifier);
            }
            else $identifier = $this->getIdentifier($view);

            $view = $identifier;
        }

        $this->_view = $view;

        return $this->_view;
    }
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);
    }
683878
public function fetch($view, array $data = [])
    {
        $file = $this->getViewFile($view);

        if (!is_file($file)) {
            throw new \RuntimeException("cannot render '$view' because the view file does not exist. File: $file");
        }

        /*
        foreach ($data as $k=>$val) {
            if (in_array($k, array_keys($this->attributes))) {
                throw new \InvalidArgumentException("Duplicate key found in data and renderer attributes. " . $k);
            }
        }
        */
        $data = array_merge($this->attributes, $data);

        try {
            ob_start();
            $this->protectedIncludeScope($file, $data);
            $output = ob_get_clean();
        } catch (\Throwable $e) { // PHP 7+
            ob_end_clean();
            throw $e;
        }

        return $output;
    }
1245087
public function make($view, $data = [])
    {
        if ( ! file_exists($view)) {
            throw new ViewNotFoundException("No file found at '{$view}'");
        }

        ob_start();

        if ( ! empty($data)) {
            extract($data);
        }

        include($view);

        return ob_get_clean();
    }
915890
public function getView($view)
    {
        if (Template::exists('Form/' . $view)) {
            return Template::getAdminTemplate('Form/' . $view);
        }

        return new View($view, B8_PATH . 'Form/View/');
    }
919191
public function includeFunc( View $view)
	{
		if( $this->isFunc() )
		{
			Helper::includeFile( $this->getFuncFilePath(), ["view" => $view], false, true );
		}
		return $this;
	}
942735
public function make($view, $data = [], $mergeData = [])
    {
        if (isset($this->aliases[$view])) {
            $view = $this->aliases[$view];
        }

        try {
            $view = $this->normalizeName($view);
            $path = $this->finder->find($view);
            $data = array_merge($mergeData, $this->parseData($data));
            $this->callCreator($view = new View($this, $this->getEngineFromPath($path), $view, $path, $data));
            return $view;
        } catch (\Exception $e) {
            // Failing to find a view on disk will throw an exception.
            // Let this fall through to a 410 or 404 page.
        }

        // If no view is found then return the 410 page.
        try {
            $view = 'errors.410';
            $path = $this->finder->find($view);
            $data = array_merge($mergeData, $this->parseData($data));
            $this->callCreator($view = new View($this, $this->getEngineFromPath($path), $view, $path, $data));
            return $view;
        } catch (\Exception $e) {
        }

        // If we still have no page then return the 404 page.
        try {
            $view = 'errors.404';
            $path = $this->finder->find($view);
            $data = array_merge($mergeData, $this->parseData($data));
            $this->callCreator($view = new View($this, $this->getEngineFromPath($path), $view, $path, $data));
            return $view;
        } catch (\Exception $e) {
        }

        // We are hosed at this point.
        throw new \InvalidArgumentException("View [$view] not found.");
    }
959615
public function make($file) {
        if (!$file instanceof File && is_file($file)) {
            $file = new File($file);
        }
        if (!$file instanceof File) {
            $file = $this->directory->childFile($this->fileSuffix($file));
        }
        if (!$file->exist()) {
            throw new FileException($file);
        }
        if (!$this->engine instanceof EngineObject) {
            return new View($this, $file);
        }
        /** IF HAS ENGINE*/
        $cacheFile = $this->cache->getCacheFile($file->getFullName());
        if (!$cacheFile->exist() || $cacheFile->modifyTime() < $file->modifyTime()) {
            $this->engine->compile($file, $cacheFile);
        }
        return new View($this, $file, $cacheFile);
    }
834963
public function make( $views ) {
		foreach ( $views as $view ) {
			if ( $this->exists( $view ) ) {
				$engine_key = $this->getBindingForFile( $view );
				$engine = Application::resolve( $engine_key );
				return $engine->make( [$view] );
			}
		}

		throw new ViewNotFoundException( 'View not found for "' . implode( ', ', $views ) . '"' );
	}
1188900
protected static function parseView($view)
    {
        if (is_string($view)) {
            return array($view, null);
        }

        // If the given view is an array with numeric keys, we will just assume that
        // both a "pretty" and "plain" view were provided, so we will return this
        // array as is, since must should contain both views with numeric keys.
        if (is_array($view) && (isset($view[0]) || isset($view[1]))) {
            return array(
                isset($view[0]) ? $view[0] : null,
                isset($view[1]) ? $view[1] : null,
            );
        }

        // If the view is an array, but doesn't contain numeric keys, we will assume
        // the the views are being explicitly specified and will extract them via
        // named keys instead, allowing the developers to use one or the other.
        elseif (is_array($view)) {
            return array(
                isset($view['html']) ? $view['html'] : null,
                isset($view['text']) ? $view['text'] : null,
            );
        }

        throw new \RuntimeException("Invalid view.");
    }
358165
public function view( $file = null, $data = null, $encode = false )
	{
		if ( \CCView::exists( $view = static::view_namespace().'::'.$file ) )
		{
			return \CCView::create( $view, $data, $encode );
		}
		
		return \CCView::create( $file, $data, $encode );
	}