@param string|\Symfony\Component\Templating\TemplateReferenceInterface $name
@param array                                                           $parameters

@return string
14982
public function render($name, array $parameters = array())
    {
        $device = $this->requestStack->getMasterRequest()->get($this->deviceTypeField);

        if (!is_null($device) && '' !== $device) {
            $name = $this->getTemplate($name, $device);
        }

        return parent::render($name, $parameters);
    }
146349
private function getDomainRegex($template, $parameters = [])
    {
        if ($host = parse_url($template, PHP_URL_HOST)) {
            $template = $host;
        }
        if (strpos($template, '<') !== false) {
            $template = str_replace(['<', '>'], '#', $template);
        }
        $template = preg_quote($template);
        foreach ($parameters as $name => $value) {
            $template = str_replace("#$name#", $value, $template);
        }
        return '/^' . $template . '$/u';
    }
349475
public function render(array $parameters = []): string
    {
        /** @var Location $location */
        $location = $parameters['location'];
        /** @var Content $content */
        $content = $parameters['content'];
        /** @var Language $language */
        $language = $parameters['language'];
        $versionNo = $content->getVersionInfo()->versionNo;

        // nonpublished content should use parent location instead because location doesn't exist yet
        if (!$content->contentInfo->published && null === $content->contentInfo->mainLocationId) {
            $parentLocations = $this->locationService->loadParentLocationsForDraftContent($content->getVersionInfo());
            $location = reset($parentLocations);
            $versionNo = null;
        }

        $siteaccesses = $this->siteaccessResolver->getSiteaccessesForLocation(
            $location,
            $versionNo,
            $language->languageCode
        );

        if (empty($siteaccesses)) {
            return $this->twig->render(
                '@ezdesign/content/content_edit/component/preview_unavailable.html.twig'
            );
        }

        return '';
    }
1183576
protected function callMacro($name, $parameters)
    {
        $macro = static::$macros[$name];

        if ($macro instanceof Closure) {
            return call_user_func_array($macro->bindTo($this, static::class), $parameters);
        }

        return call_user_func_array($macro, $parameters);
    }
541309
public function getPath($name, $parameters = [], $relative = false)
    {
        return $this->generator->generate($name, $parameters, $relative ? UrlGeneratorInterface::RELATIVE_PATH : UrlGeneratorInterface::ABSOLUTE_PATH);
    }
420453
public function renderComponent($name, $parameters = [])
    {
        $result = null;
        $previousContext = $this->componentContext;

        if ($componentObj = $this->findComponentByName($name)) {
            $componentObj->id = uniqid($name);
            $componentObj->setProperties(array_merge($componentObj->getProperties(), $parameters));
            $this->componentContext = $componentObj;
            $result = $componentObj->onRender();
        }

        if (!$result) {
            $result = $this->renderPartial($name.'::default', [], false);
        }

        $this->componentContext = $previousContext;
        return $result;
    }
1280448
private function getArgumentByName(\ReflectionParameter $parameter, $parameters)
    {
        foreach ($parameters as $name => $item) {
            $paramName = $parameter->getName();
            if ($name === $paramName) {
                return $item;
            }
        }

        return null;
    }
337068
public function route($name, $parameters = [])
    {
        $route = router()->route($name);
        if (is_null($route)) {
            throw new \Exception("Route name [$name] not found");
        }

        $route_url = $route->url($parameters);

        return $this->to($route_url);
    }
505850
private function getParameterValue(array $parameter, $name, $default = null)
    {
        if (!array_key_exists($name, $parameter)) {
            return $default;
        }

        return $parameter[$name]->getValue();
    }
1362884
public function render($name, array $parameters = [])
    {
        $storage = $this->load($name);
        $key = hash('sha256', serialize($storage));
        $this->current = $key;
        $this->parents[$key] = null;

        // attach the global variables
        $parameters = array_replace($this->getGlobals(), $parameters);
        // render
        if (false === $content = $this->evaluate($storage, $parameters)) {
            throw new \RuntimeException(sprintf('The template "%s" cannot be rendered.', $this->parser->parse($name)));
        }

        // decorator
        if ($this->parents[$key]) {
            $slots = $this->get('slots');
            $this->stack[] = $slots->get('_content');
            $slots->set('_content', $content);

            $content = $this->render($this->parents[$key], $parameters);

            $slots->set('_content', array_pop($this->stack));
        }

        return $content;
    }
238241
public function render($name, array $parameters = array())
    {
        $storage = $this->load($name);
        $parameters = array_replace($this->getGlobals(), $parameters);

        $this->current = $key = sha1(serialize($storage));
        $this->parents[$key] = null;

        if (false === $content = $this->evaluate($storage, $parameters)) {
            throw new RuntimeException('The template cannot be rendered.');
        }

        if ($this->parents[$key]) {
            $content = $this->render($this->parents[$key], $parameters);
        }

        return $content;
    }
121525
public function callRoute($name, array $parameters = [], array $options = [])
    {
        try {
            $content = $this->router->dispatchRoute($name, $parameters, $options);
        } catch (\Exception $e) {
            return sprintf('<p style="display:block;boder:1px solid red;" class="error">%s</p>', $e->getMessage());
        }

        return is_string($content) ? $content : '';
    }
1290402
public function render(array $parameters = []): string
    {
        return $this->twig->render('@ezdesign/component/link.html.twig', [
            'href' => $this->href,
            'type' => $this->type,
            'rel' => $this->rel,
            'crossorigin' => $this->crossorigin,
            'integrity' => $this->integrity,
        ] + $parameters);
    }
893675
private function getTemplate($name)
    {
        $templates = $this->container->getParameter('sonata.formatter.ckeditor.configuration.templates');

        if (isset($templates[$name])) {
            return $templates[$name];
        }

        return null;
    }
816086
protected function crudGenerateRoute($name, array $parameters = array())
    {
        return $this->crudUrlGenerator()->generate($name, $parameters, UrlGeneratorInterface::ABSOLUTE_URL);
    }
630564
public function getTemplate($name)
    {
        dump($name);
        $templateName = $this->loader->getTemplate($name);
        try {
            $template = $this->environment->loadTemplate($templateName);
        } catch (\Twig_Error_Loader $e) {
            throw $e;
        }

        return $template;
    }
796617
private function getParameterNamesForParentCall(array $parameters)
    {
        return array_map(
            function (\ReflectionParameter $parameter) {
                $name = '';

                if ($parameter->isVariadic()) {
                    $name .= '...';
                }

                $name .= '$' . $parameter->getName();

                return $name;
            },
            $parameters
        );
    }