Renders a requested content file.
The framework uses this method internally.
@param string $name The content view to load.
@param array $parameters Parameter variables to pass to the view.
@return string
353186
public function renderContent($name, $parameters = [])
    {
        /**
         * @event cms.page.beforeRenderContent
         * Provides an oportunity to manipulate the name of the content file being rendered before it renders
         *
         * Example usage:
         *
         *     Event::listen('cms.page.beforeRenderContent', function ((\Cms\Classes\Controller) $controller, (string) $contentName) {
         *         return "path/to/overriding/location/" . $contentName;
         *     });
         *
         * Or
         *
         *     $CmsController->bindEvent('page.beforeRenderContent', function ((string) $contentName) {
         *         return "path/to/overriding/location/" . $contentName;
         *     });
         *
         */
        if ($event = $this->fireSystemEvent('cms.page.beforeRenderContent', [$name])) {
            $content = $event;
        }
        /*
         * Load content from theme
         */
        elseif (($content = Content::loadCached($this->theme, $name)) === null) {
            throw new CmsException(Lang::get('cms::lang.content.not_found_name', ['name'=>$name]));
        }

        $fileContent = $content->parsedMarkup;

        /*
         * Inject global view variables
         */
        $globalVars = ViewHelper::getGlobalVars();
        if (!empty($globalVars)) {
            $parameters = (array) $parameters + $globalVars;
        }

        /*
         * Parse basic template variables
         */
        if (!empty($parameters)) {
            $fileContent = TextParser::parse($fileContent, $parameters);
        }

        /**
         * @event cms.page.renderContent
         * Provides an oportunity to manipulate the output of a content file after being rendered
         *
         * Example usage:
         *
         *     Event::listen('cms.page.renderContent', function ((\Cms\Classes\Controller) $controller, (string) $contentName, (string) &$fileContent) {
         *         return "Overriding content";
         *     });
         *
         * Or
         *
         *     $CmsController->bindEvent('page.renderContent', function ((string) $contentName, (string) &$fileContent) {
         *         return "Overriding content";
         *     });
         *
         */
        if ($event = $this->fireSystemEvent('cms.page.renderContent', [$name, &$fileContent])) {
            return $event;
        }

        return $fileContent;
    }
460467
public function render($name = null, ...$params)
    {
        return new HtmlString(
            view($this->getView(), [
                'breadcrumbs' => $this->generate($name, $params)
            ])->render()
        );
    }
959312
public function render($name, array $params = [])
	{
		$latte = $this->createLatteEngine();
		$basePath = ['basePath' => $this->getBasePath()] ;
		$latte->render($name, $params + $basePath);
		return $latte;
	}
92531
public function renderContainer($name, $page = null, array $options = [])
    {
        $cms = $this->cmsManagerSelector->retrieve();
        $site = $this->siteSelector->retrieve();
        $targetPage = false;

        try {
            if (null === $page) {
                $targetPage = $cms->getCurrentPage();
            } elseif (!$page instanceof PageInterface && \is_string($page)) {
                $targetPage = $cms->getInternalRoute($site, $page);
            } elseif ($page instanceof PageInterface) {
                $targetPage = $page;
            }
        } catch (PageNotFoundException $e) {
            // the snapshot does not exist
            $targetPage = false;
        }

        if (!$targetPage) {
            return '';
        }

        $container = $cms->findContainer($name, $targetPage);

        if (!$container) {
            return '';
        }

        return $this->renderBlock($container, $options);
    }
227010
public function render($name, $params = null, $options = null)
    {
        return $this->get($name, $options)->render($params);
    }
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 : '';
    }
79243
protected function getContentVariable( $name )
    {
        if ( isset( $this->request->contentVariables[$name] ) )
        {
            return $this->request->contentVariables[$name];
        }

        return null;
    }
419360
public function render(Content $content, $parameters)
    {
        return $this->markdownParser->transformMarkdown($this->getFileContent($content));
    }
879010
public function render(Content $content, $parameters)
    {
        $params   = new JsonParser($this->getFileContent($content));
        $uri      = $this->context->resolveString($params->getMandatoryParam('uri'));
        $payload  = $params->getOptionalParam('payload', null);

        if(null !== $payload)
        {
            $payload = $this->context->resolveValue($payload);
        }

        $response = $this->connector
            ->to($params->getMandatoryParam('service'))
            ->doRequest($params->getMandatoryParam('method'), $uri, $payload);

        $variables = $params->getOptionalParam('variables', array());
        $variables['response'] = $response;

        $twigTemplate = $params->getMandatoryParam('template');

        if(strpos($twigTemplate, ':') === false && $twigTemplate[0] != '@')
        {
            // Build a template path in case it is relative to current file
            $twigTemplate = '@coral' . dirname($content->getPath()) . DIRECTORY_SEPARATOR . $twigTemplate;
        }

        return $this->twig->render($twigTemplate, $variables);
    }
602171
public function render($name, $content)
    {
        list($data, $content) = (array) Matter::parse($content);

        $data = array_merge($data, (array) $this->data);

        $data['title'] = isset($data['title']) ? $data['title'] : '';

        $output = $this->website->content()->make($content);

        if ($data['title'] === '') {
            preg_match('/<h1>(.*?)<\/h1>/', $output, $matches);

            isset($matches[1]) && $data['title'] = $matches[1];
        }

        $data['content'] = (string) $output;

        return $this->renderer->render($name, $data);
    }
549973
public function generateUrl(string $name, array $parameters = []): string
    {
        $definition = $this->provider->getRouteDefinitionByName($name);
        return $definition->formatUrl($parameters);
    }
59103
private function callRequestFor($name, $parameters)
    {
        if (! $this->getHttpManager()) {
            $httpClient = new GuzzleAdapter(new GuzzleClient());
            $this->setHttpManager(new HttpManager($httpClient, $this->getOptions()));
        }

        /** @var RequestInterface $request */
        $request = $this->{'get' . ucfirst($name) . 'Request'}();

        return $request->execute(
            $this->getHttpManager(),
            $this->getParameters($parameters)
        );
    }
790651
public function route($name, $parameters = [])
    {
        $path = $this->routes->getPath($name, $parameters);
        $path = ltrim($path, '/');

        return $this->baseUrl.'/'.$path;
    }
752816
public function renderView($template, array $parameters = array())
    {
        $parameters['module'] = $this->module->createView();

        return $this->getContainer()->get('templating')->render($template, $parameters);
    }
632321
protected function addCommand($name, array $parameters = array())
    {
        $this->commands[] = $command = $this->createCommand($name, $parameters);

        return $command;
    }
337804
public function route($name, $parameters = [])
    {
        $this->link_type = self::LINK_ROUTE;
        $this->link_value = [$name, $parameters];
        $this->checkActive();

        return $this;
    }
898520
public function render($view, array $parameters = array(), Response $response = null)
    {
        if (!isset($response)) {
            $response = new Response();
        }

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

        return $response;
    }