Make a new view

@param  string $path
@param  array  $data
@return
196744
public function make(string $path, array $data = [])
	{
		$cached = $this->isCached($path);
		extract($data);

		ob_start();
		eval('?> '.$cached);
		$output = ob_get_contents();;
		ob_end_clean();
		return $output;
	}
787389
protected function request($path, $method, array $data = array()) {
		$request = new Request();
		$response = new Response();
		$transport = $this->getTransport();

		$request->setMethod($method);
		$request->setResource($this->buildPath($path));
		$request->setHost(self::URI);
		$request->addHeader('Authorization: Basic ' . base64_encode($this->getAuthCredentials()));
		$request->addHeader('User-Agent: ' . $this->getUserAgent());

		if (count($data)) {
			$request->addHeader('Content-Type: application/json');
			$request->setContent(json_encode($data));
		}

		$transport->send($request, $response);

		return json_decode($response->getContent());
	}
1048343
protected function generateView($view, $data = [])
    {
        if(is_null($this->viewPath)) {
            return $view;
        }

        $twig = new Twig_Environment(
            new Twig_Loader_Filesystem(realpath($this->viewPath))
        );

        return $twig->render($view, $data);
    }
600731
public static function renderView($path, $dataName = '', $data = '')
    {
        $view = new self();
        if (!empty($dataName)) {
            $view->with($dataName, $data);
        }

        return $view->render($path, false);
    }
486423
public function create($view = null, array $data = [])
    {
        if (is_null($view)) {
            return $this;
        }

        return $this->render($view, $data, true)->content();
    }
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());
    }
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.");
    }
1026234
public function arrayUnset(array $data, string $path)
    {
        $dot = new Dot($data);
        $dot->delete($path);

        return $dot->all();
    }
198323
protected function evaluatePath($path, $data)
	{
		foreach ($data as $var => $val)
			$this->smarty->assign($var, $val);

		return $this->smarty->fetch($path);
	}
209550
public function add_to_obj(string $path, $data=[], $internal = false)
  {
    if ( substr($path, 0, 2) === './' ){
      $path = $this->say_dir().substr($path, 1);
    }
    if ( $route = $this->mvc->get_route($path, $internal ? 'private' : 'public') ){
      $o = new controller($this->mvc, $route, $data);
      $o->process();
      $this->obj = \bbn\x::merge_objects($this->obj, $o->obj);
      return $this;
    }
    return false;
  }
909569
public function render($path = 'basic', $views = null)
    {
        $view = new View();
        if (is_null($views)) {
            $views = __DIR__.'/views/';
        }

        $view->createBlade($views, $this->_config->get('cache'));

        return $view->with('pagination', [
            'currentPage' => $this->_page,
            'totalPages'  => $this->_totalPages,
            ])->render($path);
    }
28473
public function make($view, array $data = [])
    {
        $location = $this->finder->find($view);

        if ( ! $location) {
            throw new \Exception(sprintf('View `%s` cannot be found!', $view));
        }

        return new View($location, $view, $data);
    }
125939
private function buildQuery(array $data, string $path = ''): string
    {
        if ([] === $data) {
            return '';
        }

        $query = '';
        foreach ($data as $key => $value) {
            if (null === $value) {
                continue;
            }

            $subPath = '' !== $path ? $path.'['.$key.']' : (string) $key;
            if (is_array($value)) {
                $query .= $this->buildQuery($value, $subPath);
            } else {
                $query .= $subPath.'='.urlencode($this->getValueAsString($value));
            }
            $query .= '&';
        }

        $query = substr($query, 0, -strlen('&'));

        return $query;
    }
259011
public function make($view, $data = [])
    {
        try {
            return $this->view->make($view, $data)->render();
        } catch (\InvalidArgumentException $e) {
            throw new ViewNotFoundException("No file found at '{$view}'");
        }
    }
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;
    }
904082
public function file($path, $data = [], $mergeData = [])
    {
        $data = array_merge($mergeData, $this->parseData($data));

        return tap($this->viewInstance($path, $path, $data), function ($view) {
            $this->callCreator($view);
        });
    }
734145
protected function createView($path)
    {
        $contents = $this->getViewContents();

        file_put_contents($path,$contents);

        $this->info('View created successfully.');
    }