Recursively process given $parameters using ParameterProcessor.

@see \Netgen\Bundle\EzPlatformSiteApiBundle\QueryType\ParameterProcessor

@param mixed $parameters
@param \Netgen\Bundle\EzPlatformSiteApiBundle\View\ContentView $view

@return array|string
776760
private function processParameters($parameters, ContentView $view)
    {
        if (!is_array($parameters)) {
            return $this->parameterProcessor->process($parameters, $view);
        }

        $processedParameters = [];

        foreach ($parameters as $name => $subParameters) {
            $processedParameters[$name] = $this->processParameters($subParameters, $view);
        }

        return $processedParameters;
    }
504173
public function get( $view, $params = array() )
	{
		$template = preg_replace( '/\./', '/', $view );

		$theme_path =  get_template_directory() . '/views/' . $template . '.php';

		$plugin_path = $this->views_path . $template . '.php';

		$path = is_readable( $theme_path )
			? $theme_path
			: ( is_readable( $plugin_path )
				? $plugin_path
				: null
			);

		if ( ! empty( $path ) ) {
			extract( $params );
			ob_start();
			include( $path );
			return ob_get_clean();
		} else {
			return;
		}
	}
1315959
public function execute(string $view, array $arguments)
    {
        /**
         * @var Closure $sandbox
         * @var Context $content
         */

        /**
         * @param string $__flow__view
         *
         * @return string
         */
        $sandbox = function (string $__flow__view)
        {
            include $this->native->path($__flow__view);

            return $this->ext->blocks()->getExtends();
        };

        $content  = clone $this->content;
        $_view    = $view;
        $iterator = 0;

        $content->mergeData($arguments);

        do
        {
            if ($iterator >= $this->limit)
            {
                throw new Runtime('The application is not responding');
            }

            $iterator++;

            $_view = $sandbox->call(
                $content,
                $_view
            );
        }
        while ($_view);
    }
1276721
public function render(string $view, array $params = []): string
    {
        return $this->make($view, $params)->render();
    }
511208
private function injectSupportedParameters(array &$parameters, $queryTypeName, ContentView $view)
    {
        $queryType = $this->queryTypeRegistry->getQueryType($queryTypeName);

        if (!$queryType instanceof SiteQueryType) {
            return;
        }

        if (!array_key_exists('content', $parameters) && $queryType->supportsParameter('content')) {
            $parameters['content'] = $view->getSiteContent();
        }

        if (!array_key_exists('location', $parameters) && $queryType->supportsParameter('location')) {
            $parameters['location'] = $view->getSiteLocation();
        }
    }
492540
public function render($view, $params = array(), $context = null)
    {
        if ($context === null) {
            $context = $this->context;
        }

        return parent::render($view, $params, $context);
    }
532377
protected function parseView($view)
    {
        if (is_string($view)) {
            return array($view, null, 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])) {
            return array($view[0], $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.
        else if (is_array($view)) {
            return array(
                Arr::get($view, 'html'),
                Arr::get($view, 'text'),
                Arr::get($view, 'raw'),
            );
        }

        throw new \InvalidArgumentException("Invalid view.");
    }
330785
protected function parseQueryParameters(array $parameters = [])
    {
        foreach ($parameters as $key => $candidate) {
            if (is_a($candidate, 'Tmdb\Model\Common\QueryParameter\QueryParameterInterface')) {
                $interfaces = class_implements($candidate);

                if (array_key_exists('Tmdb\Model\Common\QueryParameter\QueryParameterInterface', $interfaces)) {
                    unset($parameters[$key]);

                    $parameters[$candidate->getKey()] = $candidate->getValue();
                }
            }
        }

        return $parameters;
    }
243063
protected function render(string $view, array $params = []): Response
    {
        $this->getTemplateEngine()->addGlobal('_request', $this->getRequest());
        $template = $this->getTemplateEngine()->render($view, $params);

        return $this->getResponse()->setContent($template);
    }
310036
private function runQuery(ContentView $view, $method)
    {
        $searchResults = $this->searchService->$method(
            $this->contentViewQueryTypeMapper->map($view)
        );
        $view->addParameters([$view->getParameter('query')['assign_results_to'] => $searchResults]);
    }
1177538
public function render($view, array $params = array())
    {
        $this->setView($view);
        $this->setParams( array_merge($this->getDefaultViewParams(), $params) );
        $this->setOutput( $this->twig->render($this->getView(), $this->getParams()) );
        return $this->getOutput();
    }
883227
public function render($view, $params = [])
  {
    // Check empty $params or not
    if (isset($params)) {
      $this->params = $params;
    }

    // Init Twig Template Engine   
    $loader = new \Twig_Loader_Filesystem('templates/');
    $twig = new \Twig_Environment($loader, array(
        'cache' => false
    ));

    // Default Global var and classes
    $twig->addGlobal('middleware', new Middleware());
    $twig->addGlobal('csrf_token', CsrfSecurity::generateCsrfToken());
    $twig->addGlobal('homePath', siteURL());

    // Add global var for all templates
    foreach($this->addGlobal as $addGlobal) {
       $twig->addGlobal($addGlobal['name'], $addGlobal['globalVar']);
    }

    // Add global Class for all templates
    foreach($this->addGlobalClass as $addGlobalClass) {
      $twig->addGlobal($addGlobalClass['name'], new $addGlobalClass['globalClass']());
    }

    // Render template
    echo $twig->render($view . '.tmp', $this->params);
  }
791964
public function render($view, array $parameters = array(), $flag = false)
    {
        $content = $this->get('kernel.dispatch')->dispatch('handle.tpl')->render($view, $parameters);
        
        return $flag ? $content : $this->responseHtml($content);
    }
920611
public function renderResponse($view, array $parameters = array(), Response $response = null)
    {
        if (null === $response) {
            $response = new Response();
        }

        $response->setContent($this->render($view, $parameters));

        return $response;
    }
1351412
public function build(HtmlView $view, array $attrs = null, array $ulAttrs = null, array $liAttrs = null, array $aAttrs = null) {
		$pageState = $view->lookup(PageState::class);
		CastUtils::assertTrue($pageState instanceof PageState);
		
		$navItemBuilder = null;
		if ($this->navItemBuilder === null) {
			$navItemBuilder = new CommonNavItemBuilder();
		} else if ($this->navItemBuilder instanceof NavItemBuilder) {
			$navItemBuilder = $this->navItemBuilder;
		} else {
			$navItemBuilder = $view->lookup($this->navItemBuilder);
			if (!($navItemBuilder instanceof NavItemBuilder)) {
				throw new UiException('Invalid NavItemBuilder: ' . $navItemBuilder);
			}
		}
		
		$navFactory = new NavFactory($navItemBuilder, $view->getN2nLocale(), $this->numLevels, $this->numOpenLevels);
		if ($pageState->hasCurrent()) {
			$navFactory->setCurrentNavBranch($pageState->getCurrentNavBranch());
		}
		$navFactory->setNumLevels($this->numLevels);
		$navFactory->setNumOpenLevels($this->numOpenLevels);
		$navFactory->setRootUlAttrs((array) $attrs);
		$navFactory->setUlAttrs((array) $ulAttrs);
		$navFactory->setLiAttrs((array) $liAttrs);
		$navFactory->setAAttrs((array) $aAttrs);
		
		$n2nLocale = $view->getN2nLocale();
		$navBranch = $this->navBranchCriteria->determine($pageState, $n2nLocale, $view->getN2nContext());
		$startLevel = 1;
		if ($this->absStartlevelNo !== null) {
			$startLevel = $this->absStartlevelNo - $navBranch->getLevel();
		} else if ($this->relStartLevelNo !== null) {
			$startLevel = $this->relStartLevelNo;
		}
		
		return $navFactory->create($view, $this->dertermineBases($navBranch, $startLevel));
	}
1244219
public function embedViewAction(ContentView $view): ContentView
    {
        // We should not cache ContentView because we use forms with CSRF tokens in template
        // JIRA ref: https://jira.ez.no/browse/EZP-28190
        $view->setCacheEnabled(false);

        $this->supplyPathLocations($view);
        $this->supplyContentType($view);

        return $view;
    }
500013
private function extractParametersFromContentView(ContentView $contentView)
    {
        $queryParameters = [];

        $queryOptions = $contentView->getParameter('query');
        if (isset($queryOptions['parameters'])) {
            foreach ($queryOptions['parameters'] as $name => $value) {
                $queryParameters[$name] = $this->extractParameters($contentView, $value);
            }
        }

        return $queryParameters;
    }