Get the evaluated view contents for the given string.

@param  string $contents
@param  string $unique
@param  int    $timestamp
@param  array  $data
@param  array  $mergeData
@return \Illuminate\View\View
184257
public function string($contents, $unique, $timestamp, $data = [], $mergeData = []) {
        $data = array_merge($mergeData, $this->parseData($data));

        $this->callCreator($view = new StringView($this, $this->engines->resolve('blade.string'), $contents, $unique, $timestamp, $data));

        return $view;
    }
267608
public function getTranslatedContent(string $from, string $to, string $remoteServiceKey, Content $content): Content
    {
        $translatedFields = $this->getTranslatedFields($from, $to, $remoteServiceKey, $content);

        $contentService                           = $this->repository->getContentService();
        $contentDraft                             = $contentService->createContentDraft($content->contentInfo);
        $contentUpdateStruct                      = $contentService->newContentUpdateStruct();
        $contentUpdateStruct->initialLanguageCode = $to;

        $contentType = $this->repository->getContentTypeService()->loadContentType(
            $content->contentInfo->contentTypeId
        );

        foreach ($contentType->getFieldDefinitions() as $field) {
            /** @var FieldDefinition $field */
            $fieldName = $field->identifier;
            $newValue  = $translatedFields[$fieldName] ?? $content->getFieldValue($fieldName);
            $contentUpdateStruct->setField($fieldName, $newValue);
        }

        return $contentService->updateContent($contentDraft->versionInfo, $contentUpdateStruct);
    }
18080
public function view($view, $data = [], $mergeData = [])
    {
        return $this->response(View::make($view, $data, $mergeData));
    }
266127
public function partial($partialView, $data = [], $mergeData = [])
    {
        $factory = $this->getFactory();

        return $factory->render($partialView, $data, $mergeData);
    }
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;
    }
197752
protected function renderView($view, $data, $mergeData)
    {
        $data = $data ?: [];
        $mergeData = $mergeData ?: [];

        return function () use ($view, $data, $mergeData) {
            return $this->view->make($view, $data, $mergeData)->render();
        };
    }
791953
public static function make( $view, $data = [], $mergeData = [] )
	{
		return static::__do( __FUNCTION__, args_with_keys( func_get_args(), __CLASS__, __FUNCTION__ ) );
	}
419927
public function get($expr, $unique = false)
    {
        if ((($exprs = $this->normalizedFirst($expr)) !== false) &&
            (is_array($exprs) || $exprs instanceof \Traversable)
        ) {
            $values = array();

            foreach ($exprs as $expr) {
                $o =& $this->data;
                $keys = preg_split(
                    "/([\"'])?\]\[([\"'])?/",
                    preg_replace(array("/^\\$\[[\"']?/", "/[\"']?\]$/"), "", $expr)
                );

                for ($i = 0; $i < count($keys); $i++) {
                    $o =& $o[$keys[$i]];
                }

                $values[] = & $o;
            }

            if (true === $unique) {
                if (!empty($values) && is_array($values[0])) {
                    array_walk($values, function(&$value) {
                        $value = json_encode($value);
                    });

                    $values = array_unique($values);
                    array_walk($values, function(&$value) {
                        $value = json_decode($value, true);
                    });

                    return array_values($values);
                }

                return array_unique($values);
            }

            return $values;
        }

        return self::$emptyArray;
    }
449638
public function first(array $views, $data = [], $mergeData = [])
    {
        $view = Arr::first($views, function ($view) {
            return $this->exists($view);
        });

        if (! $view) {
            throw new InvalidArgumentException('None of the views in the given array exist.');
        }

        return $this->make($view, $data, $mergeData);
    }
1360736
protected function setContent($view, $data = array(), $mergeData = array())
	{
		if ( ! is_null($view))
		{
			if (is_string($view))
			{
				$this->layout->content = View::make($view, $data, $mergeData);
			}
			else {
				$this->layout->content = $view;
			}
		}
	}
317932
protected function view($view, $data = [], $mergeData = [])
    {
        $theme = config('log-viewer.theme');

        return view()->make("log-viewer::{$theme}.{$view}", $data, $mergeData);
    }
744843
public function renderHtml(string $latteFile, array $data, string $tempFolderLatte = '/tmp/latte'): string
    {
        $latte = new Engine();
        $latte->setTempDirectory($tempFolderLatte);
        return $latte->renderToString($latteFile, $data);
    }
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);
        });
    }
237830
protected function parseView(ExpressViewRenderer $renderer, $data, $resource = '')
	{
		try
		{
			// This ugly pre-processing is neccessary due to DOM XML forgetting about self-closing elements.
			$reader = new XmlStreamReader();
			$reader->XML($data);
			
			$buffer = '<?xml version="1.0"?>' . "\n";
			
			while($reader->read())
			{
				switch($reader->nodeType)
				{
					case XmlStreamReader::ELEMENT:
						$buffer .= '<' . $reader->name;
						
						$namespaces = [];
						
						while($reader->moveToNextAttribute())
						{
							if($reader->namespaceURI == self::NS_XML)
							{
								switch($reader->localName)
								{
									case 'nsdec':
									case 'empty':
										continue 2;
								}
							}
							
							if($reader->namespaceURI == self::NS_XMLNS)
							{
								$namespaces[$reader->name] = $reader->value;
							}
						
							$buffer .= ' ' . $reader->name . '="' . htmlspecialchars($reader->value, ENT_COMPAT | ENT_XML1 | ENT_SUBSTITUTE, 'UTF-8') . '"';
						}
						
						$reader->moveToElement();
						
						if(!empty($namespaces))
						{
							$encoded = base64_encode(json_encode($namespaces, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
							$buffer .= ' xml:nsdec="' . htmlspecialchars($encoded, ENT_QUOTES | ENT_XML1 | ENT_SUBSTITUTE, 'UTF-8') . '"';
						}
						
						if($reader->isEmptyElement)
						{
							$buffer .= ' xml:empty="" />';
						}
						else
						{
							$buffer .= '>';
						}
						break;
					case XmlStreamReader::END_ELEMENT:
						$buffer .= '</' . $reader->name . '>';
						break;
					case XmlStreamReader::SIGNIFICANT_WHITESPACE:
					case XmlStreamReader::TEXT:
					case XmlStreamReader::WHITESPACE:
						$buffer .= htmlspecialchars($reader->value, ENT_QUOTES | ENT_XML1 | ENT_SUBSTITUTE, 'UTF-8');
						break;
				}
			}
			
			// Parse XML buffer into a DOM document.
			$builder = new XmlDocumentBuilder();
			$xml = $builder->buildFromSource($buffer);
	
			$compiler = new ExpressCompiler($renderer);
			$compiler->setResource($resource);
			
			$parser = new ExpressViewParser();
			
			$view = $parser->parseSource($xml);
			$view->compile($compiler);
			
			return $compiler;
		}
		catch(\Exception $e)
		{
			$ex = $e;
			
			do
			{
				if($ex instanceof ExpressViewException)
				{
					if($ex->getErrorFile() === NULL)
					{
						$ex->setErrorFile($resource);
					}
				}
			}
			while($ex = $ex->getPrevious());
			
			throw $e;
		}
	}
999851
public function doRender($rawContent, array $attributes = [])
    {
        $renderer = $this->renderer;

        if ($renderer === null) {
            $rendered = $rawContent;
        } elseif ($renderer instanceof Renderer) {
            $rendered = $renderer->render($rawContent, $attributes);
        } elseif ($renderer instanceof \Closure) {
            $rendered = call_user_func($renderer, $rawContent, $attributes);
        } else {
            throw new \Exception('Invalid renderer given. Expecting null, instance of Gen\Renderer\Renderer or valid callback.');
        }

        return $this->renderedContent = $rendered;
    }
769439
public function make($view, $data = array(), $mergeData = array())
	{
		$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;
	}
256168
public function show($name = null, $data = []) {
        Factory::timer()->record('view render');
        return $this->showContent($this->renderHtml($name, $data));
    }