Renders provided template with parameters and returns the generated string.

@param  string     $template   the template relative path
@param  array|null $parameters
@return string
425972
public function render($template, array $parameters = null, Response $response = null)
    {
        return parent::render($this->bundle->getBaseDirectory().DIRECTORY_SEPARATOR.'Templates'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.$template, $parameters, $response);
    }
631363
public function render($template) {
		$environment = [
			'post' => $_POST,
			'get' => $_GET,
			'cookie' => $_COOKIE,
			'server' => $_SERVER,
		];

		$environment = array_merge($environment, $this->environment);

		if ($this->i18n_available === true and $this->translation !== null) {
			$environment['translation'] = $this->translation;
			$environment['language'] = $this->translation->language;
		}

		if (isset($_SESSION)) {
			$environment['session'] = $_SESSION;
		}
		$this->twig->setLoader($this->filesystem_loader);
		$this->twig->addGlobal('env', $environment);
		return $this->twig->render($template, $this->variables);
	}
628082
public function generateTemplates(array $parameters)
    {
        $relPath = '/Resources/views/Layout/';
        $sourceDir = $this->skeletonDir.$relPath;
        $targetDir = $this->getTemplateDir($this->bundle) . '/Layout/';

        if ($this->demosite) {
            $this->renderSingleFile($sourceDir, $targetDir, 'submenu.html.twig', $parameters);
        }

        // Pages

        $relPath = '/Resources/views/Pages/HomePage/';
        $sourceDir = $this->skeletonDir.$relPath;
        $targetDir = $this->getTemplateDir($this->bundle) . '/Pages/HomePage/';

        $this->renderSingleFile($sourceDir, $targetDir, 'pagetemplate.html.twig', $parameters);
        $this->renderSingleFile($sourceDir, $targetDir, 'view.html.twig', $parameters);

        $relPath = '/Resources/views/Pages/ContentPage/';
        $this->renderFiles($this->skeletonDir.$relPath, $this->getTemplateDir($this->bundle) . '/Pages/ContentPage/', $parameters, true);

        if ($this->demosite) {
            $relPath = '/Resources/views/Pages/FormPage/';
            $this->renderFiles($this->skeletonDir.$relPath, $this->getTemplateDir($this->bundle) . '/Pages/FormPage/', $parameters, true);

            $relPath = '/Resources/views/Pages/SearchPage/';
            $this->renderFiles($this->skeletonDir.$relPath, $this->getTemplateDir($this->bundle) . '/Pages/SearchPage/', $parameters, true);
        }

        // Pageparts

        if ($this->demosite) {
            $relPath = '/Resources/views/PageParts/PageBannerPagePart/';
            $this->renderFiles($this->skeletonDir.$relPath, $this->getTemplateDir($this->bundle) . '/PageParts/PageBannerPagePart/', $parameters, true);

            $relPath = '/Resources/views/PageParts/ServicePagePart/';
            $this->renderFiles($this->skeletonDir.$relPath, $this->getTemplateDir($this->bundle) . '/PageParts/ServicePagePart/', $parameters, true);

            $relPath = '/Resources/views/PageParts/UspPagePart/';
            $this->renderFiles($this->skeletonDir.$relPath, $this->getTemplateDir($this->bundle) . '/PageParts/UspPagePart/', $parameters, true);

            $relPath = '/Resources/views/PageParts/BikesListPagePart/';
            $this->renderFiles($this->skeletonDir.$relPath, $this->getTemplateDir($this->bundle) . '/PageParts/BikesListPagePart/', $parameters, true);
        }

        // Error templates
        $relPath = '/Resources/views/Error/';
        $this->renderFiles($this->skeletonDir.$relPath, $this->getTemplateDir($this->bundle) . '/Error/', $parameters, true);

        $sourcePath = '/app/TwigBundle/';
        $targetPath = $this->isSymfony4() ? $this->rootDir . '/templates/bundles/TwigBundle' : $this->rootDir . '/app/Resources/TwigBundle/';
        $this->renderFiles($this->skeletonDir . $sourcePath, $targetPath, $parameters, true);

        // Bundle overwrites

        if ($this->demosite) {
            $sourcePath = '/app/KunstmaanSitemapBundle/';
            $targetPath = $this->isSymfony4() ? $this->rootDir . '/templates/bundles/KunstmaanSitemapBundle' : $this->rootDir . '/app/Resources/KunstmaanSitemapBundle/';

            $this->renderFiles($this->skeletonDir . $sourcePath, $targetPath, $parameters, true);

            $sourcePath = '/app/KunstmaanFormBundle/';
            $targetPath = $this->isSymfony4() ? $this->rootDir . '/templates/bundles/KunstmaanFormBundle' : $this->rootDir . '/app/Resources/KunstmaanFormBundle/';
            $this->renderFiles($this->skeletonDir . $sourcePath, $targetPath, $parameters, true);
        }

        $this->assistant->writeLine('Generating template files : <info>OK</info>');
    }
69072
public static String render(String template, Map<String, Object> paras)
	{
		Template t = gt.getTemplate(template);
		t.binding(paras);
		return t.render();
	}
560558
protected function renderTemplate($template, array $context = [])
    {
        $app = $this->getContainer();

        if ($this->pathAdded === false) {
            $this->addTwigPath('templates');
            $this->pathAdded = true;
        }

        return $app['twig']->render($template, $context);
    }
47630
public function render($template = null)
    {
        if (null === $template) {
            $template = 'SilvestraAdminBundle:Menu:vertical_admin_menu.html.twig';
        }

        return $this->helper->render($template, $this->builder->build());
    }
1028186
public function render(array $parameters = []): string
    {
        $urls = $this->replaceUrlPlaceholders();

        return $this->twig->render(
            $this->template,
            $parameters + ['urls' => $urls, 'ez' => $this->ezSystemInfo] + $this->parameters
        );
    }
1233288
public function render(string $template, array $data = []): string
    {
        // we store the current state of the template variables
        // so that we have isolated cases on multiple calls to render()
        $backupVariables = $this->thisShouldMakeItUniqueCodeCollabTemplateHtmlVariables;

        if (!empty($data)) {
            $this->thisShouldMakeItUniqueCodeCollabTemplateHtmlVariables = $data;
        }

        try {
            ob_start();

            /** @noinspection PhpIncludeInspection */
            require $template;
        } finally {
            $output = ob_get_clean();
        }

        $this->thisShouldMakeItUniqueCodeCollabTemplateHtmlVariables = $backupVariables;

        return $output;
    }
777744
private function pathForTemplate(string $template): string
    {
        $pathes = $this->resourceLoader->availableResourceUris('creator/' . $template);
        if (!isset($pathes[0])) {
            throw new \RuntimeException('Could not load template ' . $template);
        }

        return $pathes[0];
    }
1255093
private function _renderTemplate($template = null)
    {
        // when no template, auto generate template path.
        // View/Content/[controller]/[action].html.twig
        $def = $this->actionChain->getCurrentAction();
        if (! $template) {
            $controller = join(DS, array_map('ucfirst', explode('_', $def['controller_name'])));
            $action = $def['action'];
            $template = sprintf('%s/%s.%s', $controller, substr($this->actionChain->actionNameStrategy($action), 0, -6), $this->renderer->getSuffix());
        }

        // rendering by renderer.
        $def['controller']->beforeRenderer();
        $result = $this->renderer->render($template);
        $this->response->setBody($result);
        if ($this->response->isHttp()) {
            $this->response->setHeader('content-type', sprintf('text/html; charset=%s', $this->application->config('encoding.output')));
        }
    }
1135051
protected function renderTemplateString( $template, array $args = [] )
	{
		foreach( $args as $key => $value ) {
			$template = str_replace( '{'.$key.'}', $value, $template );
		}
		return trim( $template );
	}
592227
public function processTemplateAction($template)
    {
        try {
            if (! empty($template)) {
                // If we have a view in the URL, render this view
                return $this->render($template);
            } elseif (null != $view = $this->getRequest()->get('view')) {
                return $this->render($view);
            }
        } catch (\Exception $ex) {
            return $this->errorPage($ex->getMessage());
        }

        return $this->pageNotFound();
    }
156781
public function renderString($template, array $data = [])
    {
        return $this->executePlainRendering(
            trim($this->compiler->compile($template)),
            array_merge($data, ['__tintin' => $this])
        );
    }
1129785
protected function _renderTemplate($template) {
		if ($section = $this->_findSection($template)) {
			list($before, $type, $tag_name, $content, $after) = $section;

			$rendered_before = $this->_renderTags($before);

			$rendered_content = '';
			$val = $this->_getVariable($tag_name);
			switch($type) {
				// inverted section
				case '^':
					if (empty($val)) {
						$rendered_content = $this->_renderTemplate($content);
					}
					break;

				// regular section
				case '#':
					// higher order sections
					if ($this->_varIsCallable($val)) {
						$rendered_content = $this->_renderTemplate(call_user_func($val, $content));
					} else if ($this->_varIsIterable($val)) {
						foreach ($val as $local_context) {
							$this->_pushContext($local_context);
							$rendered_content .= $this->_renderTemplate($content);
							$this->_popContext();
						}
					} else if ($val) {
						if (is_array($val) || is_object($val)) {
							$this->_pushContext($val);
							$rendered_content = $this->_renderTemplate($content);
							$this->_popContext();
						} else {
							$rendered_content = $this->_renderTemplate($content);
						}
					}
					break;
			}

			return $rendered_before . $rendered_content . $this->_renderTemplate($after);
		}

		return $this->_renderTags($template);
	}
861210
public function render($template, $parameters = [])
    {
        if (count($parameters) < 1) {
            $parameters = null;
        }
        echo $this->smarty->fetch($template, $parameters);
    }
811121
public function render($template, $data = null)
    {
        // Append .twig to end of path
        if(substr($template,-5)!='.twig'){
            $template.= '.twig';
        }
        $env = $this->getInstance();
        $parser = $env->loadTemplate($template);

        return $parser->render($this->all(), $data);
    }
941840
public function renderTwig(\Twig_Environment $environment, $template, array $parameters = array())
    {
        $template = $this->loadStringTemplate($environment, $template);

        return $template->render($parameters);
    }