This will get a view.

@param string $path
@param string $mode
@param array $data
@return string|false
1623
public function get_view(string $path, string $mode = 'html', array $data=null){
    if ( !router::is_mode($mode) ){
      die("Incorrect mode $path $mode");
    }
    $view = null;
    if ( $this->has_view($path, $mode) ){
      $view = self::$loaded_views[$mode][$path];
    }
    else if ( $info = $this->router->route($path, $mode) ){
      $view = new mvc\view($info);
      $this->add_to_views($path, $mode, $view);
    }
    if ( \is_object($view) && $view->check() ){
      return \is_array($data) ? $view->get($data) : $view->get();
    }
    return '';
  }
716842
public function stream_open($path, $mode, $options, &$openedPath)
    {
        $container = $this->getContainerFromContext($path);
        $path = $this->stripScheme($path);

        $mode = str_split(str_replace('b', '', $mode));

        $accessDeniedError = function () use ($path, $options) {
            if ($options & STREAM_REPORT_ERRORS) {
                trigger_error(sprintf('fopen(%s): failed to open stream: Permission denied', $path), E_USER_WARNING);
            }

            return false;
        };

        $appendMode = in_array('a', $mode);
        $readMode = in_array('r', $mode);
        $writeMode = in_array('w', $mode);
        $extended = in_array('+', $mode);

        if (!$container->hasNodeAt($path)) {
            if ($readMode || !$container->hasNodeAt(dirname($path))) {
                if ($options & STREAM_REPORT_ERRORS) {
                    trigger_error(sprintf('%s: failed to open stream.', $path), E_USER_WARNING);
                }

                return false;
            }
            $parent = $container->directoryAt(dirname($path));
            $permissionHelper = $container->getPermissionHelper($parent);
            if (!$permissionHelper->isWritable()) {
                return $accessDeniedError();
            }
            $parent->addFile($container->factory()->getFile(basename($path)));
        }

        $file = $container->nodeAt($path);

        if ($file instanceof Link) {
            $file = $file->getDestination();
        }

        if (($extended || $writeMode || $appendMode) && $file instanceof Directory) {
            if ($options & STREAM_REPORT_ERRORS) {
                trigger_error(sprintf('fopen(%s): failed to open stream: Is a directory', $path), E_USER_WARNING);
            }

            return false;
        }

        if ($file instanceof Directory) {
            $dir = $file;
            $file = $container->factory()->getFile('tmp');
            $file->chmod($dir->mode());
            $file->chown($dir->user());
            $file->chgrp($dir->group());
        }

        $permissionHelper = $container->getPermissionHelper($file);

        $this->currentlyOpenedFile = new FileHandler();
        $this->currentlyOpenedFile->setFile($file);

        if ($extended) {
            if (!$permissionHelper->isReadable() || !$permissionHelper->isWritable()) {
                return $accessDeniedError();
            }
            $this->currentlyOpenedFile->setReadWriteMode();
        } elseif ($readMode) {
            if (!$permissionHelper->isReadable()) {
                return $accessDeniedError();
            }
            $this->currentlyOpenedFile->setReadOnlyMode();
        } else { // a or w are for write only
            if (!$permissionHelper->isWritable()) {
                return $accessDeniedError();
            }
            $this->currentlyOpenedFile->setWriteOnlyMode();
        }

        if ($appendMode) {
            $this->currentlyOpenedFile->seekToEnd();
        } elseif ($writeMode) {
            $this->currentlyOpenedFile->truncate();
            clearstatcache();
        }

        $openedPath = $file->path();

        return true;
    }
655629
private function safelyWriteData($path, $mode, $data)
    {
        $fp = fopen($path, $mode);
        $retries = 0;

        if (empty($fp)) {
            return false;
        }

        do {
            if ($retries > 0) {
                usleep(static::MS_BETWEEN_RETRIES * 1000);
            }

            $retries++;
        } while (!flock($fp, LOCK_EX) && $retries <= static::MAX_RETRIES);

        if ($retries == static::MAX_RETRIES) {
            return false;
        }


        fwrite($fp, "$data\n");

        flock($fp, LOCK_UN);
        fclose($fp);

        return true;
    }
1071381
private static function add_view($path, $mode, mvc\view $view)
  {
    if ( !isset(self::$loaded_views[$mode][$path]) ){
      self::$loaded_views[$mode][$path] = $view;
    }
    return self::$loaded_views[$mode][$path];
  }
107604
protected function view( $path, $data = array() ){
		return $this->view->render( $this->response, $path, $data );
	}
460997
public function get_external_view(string $full_path, string $mode = 'html', array $data=null){
    if ( !router::is_mode($mode) ){
      die("Incorrect mode $full_path $mode");
    }
    if ( ($this->get_mode() === 'dom') && (!defined('BBN_DEFAULT_MODE') || (BBN_DEFAULT_MODE !== 'dom')) ){
      $full_path .= ($full_path === '' ? '' : '/').'index';
    }
    $view = null;
    if ( $this->has_view($full_path, $mode) ){
      $view = self::$loaded_views[$mode][$full_path];
    }
    else if ( $info = $this->router->route(basename($full_path), 'free-'.$mode, \dirname($full_path)) ){
      $view = new mvc\view($info);
      $this->add_to_views($full_path, $mode, $view);
    }
    if ( \is_object($view) && $view->check() ){
      return \is_array($data) ? $view->get($data) : $view->get();
    }
    return '';
  }
1111969
public function get_view_group($files='', array $data=null, $mode = 'html'){
    if ( !\is_array($files) ){
      if ( !($tmp = $this->mvc->fetch_dir($files, $mode)) ){
        $this->error("Impossible to get files from directory $files");
        return false;
      }
      $files = $tmp;
    }
    if ( \is_array($files) && \count($files) ){
      $st = '';
      foreach ( $files as $f ){
        if ( $tmp = $this->get_view($f, $mode, $data) ){
          $st .= $tmp;
        }
      }
      return $st;
    }
    $this->error('Impossible to get files from get_view_group files argument empty');
  }
337393
public function get($path, array $data = array())
    {
        $this->lastCompiled[] = $path;

        // If this given view has expired, which means it has simply been edited since
        // it was last compiled, we will re-compile the views so we can evaluate a
        // fresh copy of the view. We'll pass the compiler the path of the view.
        if ($this->compiler->isExpired($path)) {
            $this->compiler->compile($path);
        }

        $raw = (isset($data['raw']) && $data['raw']) ? true : false;
        $compiled = $this->compiler->getCompiledPath($path, $raw);

        // convert objects to arrays
        $data = array_map('self::convertObjectToArray', $data);

        // Once we have the path to the compiled file, we will evaluate the paths with
        // typical PHP just like any other templates. We also keep a stack of views
        // which have been rendered for right exception messages to be generated.
        $results = $this->evaluatePath($compiled, $data);

        array_pop($this->lastCompiled);

        return $results;
    }
1370200
public function stream_open($path, $mode, $options, &$opened_path)
	{
		$this->path = $path;
		$this->resource = fopen($this->getLocalFilesystemPath($path), $mode);
		
		return is_resource($this->resource);
	}
376224
public function fileOpen(string $path, string $mode, int $options)
    {
        $entity = $this->getEntity($path);

        $filePointer = null;
        if (null !== $entity) {
            $exists = $entity->file_exists();

            if ($exists && !$entity->is_file()) {
                $filePointer = null;
            } else {
                $fopenWillFail = false;
                $mode = strtolower($mode);
                if ('r' != $mode) {
                    $isVirtual = ($entity instanceof VirtualInterface);
                    if (!$exists || !$isVirtual) {
                        $tmpPath = $this->tempnam();
                        $basename = basename($path);

                        if ($exists) {
                            if ('x' == $mode || 'x+' == $mode) {
                                $fopenWillFail = true;
                            } else {
                                copy($entity->path(), $tmpPath);
                            }
                        }
                        if (!$fopenWillFail) {
                            $entity = Virtual::newInstance(
                                $entity, $tmpPath, $basename
                            );

                            $changes = $this->getChanges();
                            $changes->add($path, $entity);
                        }
                    }
                }

                if ($fopenWillFail) {
                    $entity = null;
                } else {
                    if ($options & STREAM_REPORT_ERRORS) {
                        $filePointer = fopen($entity->path(), $mode);
                    } else {
                        $filePointer = @fopen($entity->path(), $mode);
                    }
                }
            }
        }

        return $filePointer;
    }
934384
protected function getStream($path, $mode)
    {
        switch ($mode[0]) {
            case 'r':
                $this->needsCowCheck = true;

                return $this->getFilesystem()->readStream($path);

            case 'w':
                $this->needsFlush = true;

                return fopen('php://temp', 'w+b');

            case 'a':
                return $this->getAppendStream($path);

            case 'x':
                return $this->getXStream($path);

            case 'c':
                return $this->getWritableStream($path);
        }

        return false;
    }
869461
public static function vue($path, array $data = null)
		{
			$path   = \View::getFinder()->find($path);
			$str    = file_get_contents($path);
			if($data)
			{
				$tag1 = '<scr'.'ipt>';
				$tag2 = '</scr'.'ipt>';
				$json = json_encode($data);
				$str = str_replace($tag1, $tag1 . "(function () {\n\tvar \$data = $json;", $str);
				$str = str_replace($tag2, '}())' . $tag2, $str);
			}
			return $str;
		}
888657
public function view($path, array $params = [])
    {
        $params = array_merge($params,
            [
                'module' => $this,
                'module_resource' => 'module_resource::' . $this->author . '.' . $this->name . '.resources.'
            ]);
        return view('module_resource::' . $this->author . '.' . $this->name . '.resources.' . $path, $params);
    }
456748
public function renderizate($path, $file, $data = null)
    {
        $file = $path . $file . '.php';

        if ($data) {
            self::$data[self::setHash($file)] = $data;
        }

        require_once $file;

        return true;
    }
1012309
public function renderFirst(array $data = [], string $path = 'gridView', array $mergeData = []): string
    {
        $path = $path === 'gridView' ? 'part.tableTrItem' : $path;

        $headers = $data['data']->headers;
        $item = (array)$data['data']->data;

        return static::view($path, [
            'headers' => $headers,
            'item'    => $item,
        ], $mergeData)->render();
    }
1220627
public function get($path, array $data = array())
    {
        // Instance Twig compiler.
        $twigCompiler = new TwigCompiler($this->app['config'], $this->app['view']);

        return $twigCompiler->render($path, $data);
    }
647868
public function stream_open($path, $mode, $options, &$opened_path)
    {
        $contents = self::cache()->get($path);
        $fileExists = (false !== $contents);

        switch ($mode) {
            case 'r':
            case 'rb':
            case 'r+':
            case 'rb+':
                if (! $fileExists) {
                    return false;
                }

                $this->fd = fopen('php://memory', "wb+");
                fwrite($this->fd, $contents);
                fseek($this->fd, 0, SEEK_SET);
                break;

            case 'w':
            case 'wb':
            case 'w+':
            case 'wb+':
                $this->fd = fopen('php://memory', "wb+");
                break;

            case 'a':
            case 'ab':
            case 'a+':
            case 'ab+':
                $this->fd = fopen('php://memory', "wb+");

                if ($fileExists) {
                    fwrite($this->fd, $contents);
                    fseek($this->fd, 0, SEEK_END);
                }
                break;

            default:
                return false;
        }

        $this->path = $path;
        $this->mode = $mode;

        return true;
    }