Renders an internal template.

@since [*next-version*]

@throws CouldNotRenderExceptionInterface If the template could not be rendered.
@throws RendererExceptionInterface       If a problem related to a renderer occurs.
345757
protected function _render()
    {
        try {
            $template = $this->_getTemplate();
            $context  = $this->_getContextFor($template);

            return $this->_renderTemplate($template, $context);
        } catch (RootException $e) {
            throw $this->_throwCouldNotRenderException($this->__('Could not render template'), null, $e);
        }
    }
379666
@Override
	public void render() {
		final HttpServletResponse response = Response.getServletResponse();
		response.setContentType(this.contentType);
		ServletOutputStream out = null;
		try {
			out = Response.getOutputStream();
			this.template.render(Request.getParamMap(), out);
		} catch (IOException e) {
			throw new IORuntimeException(e);
		} finally {
			IoUtil.close(out);
		}
	}
548199
public function renderRenderable(RootRenderableInterface $renderable)
    {
        $renderable->beforeRendering($this->formRuntime);

        $renderableType = $renderable->getType();

        if ($renderable->getRendererClassName() !== null && $renderable->getRendererClassName() !== get_class($this)) {
            $rendererClassName = $renderable->getRendererClassName();
            $renderer = new $rendererClassName;
            if (!($renderer instanceof RendererInterface)) {
                throw new RenderingException(sprintf('The renderer class "%s" for "%s" does not implement RendererInterface.', $rendererClassName, $renderableType), 1326098022);
            }
            $renderer->setControllerContext($this->controllerContext);
            $renderer->setFormRuntime($this->formRuntime);
            return $renderer->renderRenderable($renderable);
        }

        $renderingOptions = $renderable->getRenderingOptions();

        $renderablePathAndFilename = $this->getPathAndFilenameForRenderable($renderableType, $renderingOptions);
        $parsedRenderable = $this->getParsedRenderable($renderable->getType(), $renderablePathAndFilename);
        $currentTemplatePathsResolver = $this->getTemplatePaths();
        $newTemplatePathsResolver = $this->createTemplatePathsResolverWithRenderingOptions($renderingOptions);
        $this->baseRenderingContext->setTemplatePaths($newTemplatePathsResolver);

        if ($this->getCurrentRenderingContext() === null) {
            // We do not have a "current" rendering context yet, so we use the base rendering context
            $this->baseRenderingContext->setControllerContext($this->controllerContext);
            $renderingContext = $this->baseRenderingContext;
        } else {
            $renderingContext = clone $this->getCurrentRenderingContext();
        }
        $renderingContext->getViewHelperVariableContainer()->addOrUpdate(FluidFormRenderer::class, 'currentRenderable', $renderable);

        if (!isset($renderingOptions['renderableNameInTemplate'])) {
            throw new RenderingException(sprintf('The Renderable "%s" did not have the rendering option "renderableNameInTemplate" defined.', $renderableType), 1326094948);
        }

        $templateVariableContainer = new TemplateVariableContainer(array($renderingOptions['renderableNameInTemplate'] => $renderable));
        $renderingContext->setVariableProvider($templateVariableContainer);

        if ($parsedRenderable->hasLayout()) {
            $renderableLayoutName = $parsedRenderable->getLayoutName($renderingContext);
            $renderableLayoutPathAndFilename = $this->getPathAndFilenameForRenderableLayout($renderableLayoutName, $renderingOptions);
            $parsedLayout = $this->getParsedRenderable($renderableLayoutName, $renderableLayoutPathAndFilename);

            $this->startRendering(self::RENDERING_LAYOUT, $parsedRenderable, $renderingContext);
            $output = $parsedLayout->render($renderingContext);
            $this->stopRendering();
        } else {
            $this->startRendering(self::RENDERING_TEMPLATE, $parsedRenderable, $renderingContext);
            $output = $parsedRenderable->render($renderingContext);
            $this->stopRendering();
        }

        $this->baseRenderingContext->setTemplatePaths($currentTemplatePathsResolver);
        $output = $this->formRuntime->invokeRenderCallbacks($output, $renderable);
        return $output;
    }
555959
public function render(Smarty_Internal_Template $_template)
    {
        if ($_template->source->handler->uncompiled) {
            if ($_template->smarty->debugging) {
                $_template->smarty->_debug->start_render($_template);
            }
            $this->handler->renderUncompiled($_template->source, $_template);
            if (isset($_template->parent) && $_template->parent->_objType == 2 && !empty($_template->tpl_function)) {
                $_template->parent->tpl_function =
                    array_merge($_template->parent->tpl_function, $_template->tpl_function);
            }
            if ($_template->smarty->debugging) {
                $_template->smarty->_debug->end_render($_template);
            }
        }
    }
445701
private void renderRenderable(IAnimatedRenderable renderable)
	{
		this.renderable = renderable;
		set(renderable.getWorld(), renderable.getPos());
		posOffset = new Vec3d(pos.getX(), pos.getY(), pos.getZ());

		renderable.renderAnimated(block, this);
	}
282844
function(el, template, context, opts) {
      opts = opts || {};
      if (_.isString(template)) {
        opts.newHTML = template;
      }
      templateRenderer.render(el, template, context, opts);
    }
181355
public function renderParentBlock(OutputBuffer $out, $name)
	{
		if($this->getParent() === NULL)
		{
			throw new \RuntimeException('Cannot render parent block because no template is inherited');
		}
		
		$this->parent->renderBlock($out, $name);
	}
293471
@Override
	public void paint(final RenderContext renderContext) {

		if (!(renderContext instanceof WebXmlRenderContext)) {
			throw new SystemException("Unable to render to " + renderContext);
		}

		PrintWriter writer = ((WebXmlRenderContext) renderContext).getWriter();

		Template template = null;

		try {
			template = VelocityEngineFactory.getVelocityEngine().getTemplate(templateUrl);
		} catch (Exception ex) {
			String message = "Could not open velocity template \"" + templateUrl + "\" for \"" + this.
					getClass().getName() + "\"";
			LOG.error(message, ex);
			writer.println(message);
			return;
		}

		try {
			VelocityContext context = new VelocityContext();
			fillContext(context);

			template.merge(context, writer);
		} catch (ResourceNotFoundException rnfe) {
			LOG.error("Could not find template " + templateUrl, rnfe);
		} catch (ParseErrorException pee) {
			// syntax error : problem parsing the template
			LOG.error("Parse problems", pee);
		} catch (MethodInvocationException mie) {
			// something invoked in the template
			// threw an exception
			Throwable wrapped = mie.getWrappedThrowable();

			LOG.error("Problems with velocity", mie);

			if (wrapped != null) {
				LOG.error("Wrapped exception...", wrapped);
			}
		} catch (Exception e) {
			LOG.error("Problems with velocity", e);
		}
	}
227938
public function render()
    {
        $iter = $this->getIterator();
        foreach ($iter as $this->current_id => $this->current_row) {
            if ($this->current_row instanceof Model || $this->current_row instanceof \atk4\data\Model) {
                /** @type Model $this->current_row */
                $this->current_row = $this->current_row->get();
            } elseif (!is_array($this->current_row) && !($this->current_row instanceof ArrayAccess)) {
                // Looks like we won't be able to access current_row as array, so we will
                // copy it's value inside $this->current instead and produce an empty array
                // to be filled out by a custom iterators
                $this->current = $this->current_row;
                $this->current_row = get_object_vars($this->current);
            }

            $this->formatRow();
            $this->output($this->rowRender($this->template));
        }
    }
724009
public function render(array $parameters = array())
	{
		if ($this->templateName === null) {
			throw new \RuntimeException('Template name was not specified, nothing to render.');
		}

		$this->output(
				$this->templating->render(
						$this->templateName,
						array_merge($this->parameters, $parameters)
				)
		);
	}
660787
public function render()
    {
        if (!$this->visible) {
            return;
        }

        $is_null = $this->strict ? $this->text === null : $this->text == null;

        if ($is_null) {
            $this->text = $this->null_text;

            echo '<span class="swat-null-text-cell-renderer">';
            parent::render();
            echo '</span>';

            // Reset the text so that subsequent $is_null checks pass.
            $this->text = null;
        } else {
            parent::render();
        }
    }
1303023
public function renderException($exception)
	{
		if (!$this->getOption('v', 0))
		{
			$this->out('')->out($exception->getMessage());

			return;
		}

		parent::renderException($exception);
	}
455596
@Override
	public void render() {
		try {
			final HttpServletRequest request = Request.getServletRequest();
			request.getRequestDispatcher(uri).forward(request, Response.getServletResponse());
		} catch (Exception e) {
			throw new RenderException("Forward to " + uri + " error!", e);
		}
	}
1129624
protected function render()
    {
        // It's better if the path of the template file is assigned.
        if( $this->template == null || file_exists( $this->template ) == false )
        {
            throw new MTemplateNotFoundException( ( $this->template == null ? 'null' : $this->template ) );
        }

        if( $this->isVisible === false )
        {
            return;
        }

        ob_start();

        /** @noinspection PhpIncludeInspection */
        include $this->template;

        $this->getHttpResponse()->appendOutput( ob_get_clean() );
    }
102179
public function render()
    {
        // Set the request arguments as GET parameters
        $_GET = $this->getRequestArguments();

        try {
            $rendererClassName = $this->element->getRendererClassName();

            /** @var FluidFormRenderer $renderer */
            $renderer = $this->objectManager->get($rendererClassName);
            if (!($renderer instanceof RendererInterface)) {
                throw new RenderingException(
                    sprintf('The renderer "%s" des not implement RendererInterface', $rendererClassName),
                    1326096024
                );
            }
            $renderer->setControllerContext($this->controllerContext);

            $this->controllerContext->getRequest()->setOriginalRequestMappingResults($this->validationErrors);
            $response = $this->objectManager->get(Response::class, $this->controllerContext->getResponse());
            /** @var FormRuntime $form */
            $form = $this->form->bind($this->controllerContext->getRequest(), $response);
            $renderer->setFormRuntime($form);

            $result = $this->beautify($renderer->render());

            // In case of an error
        } catch (\Exception $e) {
            $result = '<pre class="error"><strong>'.$e->getMessage().'</strong>'.PHP_EOL
                      .$e->getTraceAsString().'</pre>';
        }

        return $result;
    }
1009281
public function render()
	{
		$this->_path = $this->getPath();

		if (! is_readable($this->_path)) {
			Request::setHttpHeader(Request::HEADER_404);
			$this->setFile(static::ERROR_404);
			$this->_path = $this->getPath();

			if (! is_readable($this->_path)) {
				throw new Exception("View file '" . $this->_path . "' doesn't exists");
			}
		}

		$template = self::getTemplateConfig();
		if (! is_array($template) or ! isset($template['type'])) {
			throw new Exception("A template and a template type are required to render the view");
		}

		$this->_type = $template['type'];

		if (isset($template['file'])) {
			$template = APP_PATH
				        . Agl::APP_TEMPLATE_DIR
				        . $template['file']
				        . Agl::PHP_EXT;

			require($template);
		} else {
			require($this->_path);
		}

		$buffer = ob_get_clean();

		Observer::dispatch(Observer::EVENT_VIEW_RENDER_BUFFER_BEFORE, array(
			'view'   => $this,
			'buffer' => &$buffer
		));

		return $this->_prepareRender($buffer);
	}
1078044
private function render_layout()
    {
        $snap_layout_path = \locate_template(Config::get('theme.templates_directory') . '/' . $this->extends);

        if ($snap_layout_path === '') {
            throw new Templating_Exception('Could not find layout: ' . $this->extends);
        }

        /**
         * Keep PHPStorm quiet.
         *
         * @noinspection PhpIncludeInspection
         */
        include $snap_layout_path;
    }