Render contents of a named block.

@param OutputBuffer $out
@param string $name Name of the block to be rendered.

@throws \RuntimeException When no such block exists.
359208
public function renderBlock(OutputBuffer $out, $name)
	{
		$method = 'block_' . $name;
		
		if(method_exists($this, $method))
		{
			$this->$method($out);
		}
		elseif($this->getParent() !== NULL)
		{
			$this->parent->renderBlock($out, $name);
		}
		else
		{
			throw new \RuntimeException(sprintf('Block not found: "%s"', $name));
		}
	}
1276235
public function output(string $name): void
	{
		$parent = $this->close();

		$output = current($this->blocks[$name]);

		unset($this->blocks[$name]);

		if(!empty($parent))
		{
			$output = str_replace('__PARENT__', $parent, $output);
		}

		echo $output;
	}
219789
protected function renderNestedNodes(OutputBuffer $out)
	{
		foreach((array)$this->__nestedNodes as $node)
		{
			$node($out);
		}
		
		return $out;
	}
1344776
protected function renderBlock($name, $parameters)
    {
        /** @var Twig_TemplateInterface $template */
        foreach ($this->getTemplates() as $template) {
            if ($template->hasBlock($name)) {

                $context = array_merge(
                    $template->getEnvironment()->getGlobals(),
                    $parameters
                );

                return $template->renderBlock($name, $context);
            }
        }

        throw new \InvalidArgumentException(sprintf('Block "%s" doesn\'t exist in grid template.', $name));
    }
1039201
public function render($name, array $context = [])
    {
        $renderedHtml = $this->twig->render($name, $context);

        foreach ($this->postProcessors as $postProcessor) {
            if ($postProcessor instanceof PostProcessorInterface) {
                $renderedHtml = $postProcessor->process($renderedHtml, $name, $context, $this->twig);
            }
        }

        return $renderedHtml;
    }
387010
public function render($name) {
		
		$logger = Logger::getInstance();
		
		$logger->addEvent('Rendering ' . $name . ' widget');
		
		$file = $this->scriptPath . $name .'.php';

		// close buffer and parse file
		ob_start();
		$script = require $file;
		$widget = ob_get_clean();

		return $widget;
		
	}
270384
public function renderTemplate($name)
    {
        $data = array_merge($this->view_data, $this->view);
        $template = $this->getRealPath('template' . DSC . $name);
        $this->loadView($template, $data);
    }
61454
public function renderParentBlock(OutputBuffer $out, $name)
	{
		$method = 'block_' . $name;

		if(method_exists($this, $method))
		{
			return $this->$method($out);
		}
		
		return parent::renderParentBlock($out, $name);
	}
805536
public function block($name)
    {
        $this->currentBlock = $name;

        $this->getBlockQueue()->push($name);

        // Start an output buffer.
        ob_start();
    }
1042922
protected function _renderBlocks($name, $attribs = array())
    {
        $html   = '';
        $count  = 1;
        $blocks = $this->getBlocks($name);

        foreach($blocks as $block)
        {
            //Set the block attributes
            if($count == 1) {
                $attribs['rel']['first'] = 'first';
            }

            if($count == count($blocks)) {
                $attribs['rel']['last'] = 'last';
            }

            if(isset($block['attribs'])) {
                $block['attribs'] = array_merge((array) $block['attribs'], $attribs);
            } else {
                $block['attribs'] = $attribs;
            }

            //Render the block
            $content = $this->_renderBlock($block);

            //Prepend or append the block
            if($block['extend'] == 'prepend') {
                $html = $content.$html;
            } else {
                $html = $html.$content;
            }

            $count++;
        }

        return $html;
    }
90597
public function displayBlock($name, array $context, array $blocks = array())
    {
        $name = (string) $name;

        if (isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
            unset($blocks[$name]);
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }

        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Twig_Error $e) {
                throw $e;
            } catch (Exception $e) {
                throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getTemplateName(), $e);
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks));
        }
    }
479548
public static void writeResults(final String name, final Object output) {
		Writer writer = null;

		try {
			writer = new BufferedWriter(
					new OutputStreamWriter(
					new FileOutputStream(name + ".json"), "utf-8"));

			writer.write(output.toString());
		} catch (IOException ignored) {
		} finally {
			try {writer.close();}
            catch (Exception ignored) {}
		}
	}
1314969
protected function renderHtml($name = null, $data = []) {
        if (is_array($name)) {
            $data = $name;
            $name = null;
        }
        return $this->renderFile($this->getViewFile($name), $data);
    }
266668
private function renderView($name)
    {
        return $this->layout
            ->with($this->data)
            ->nest('content', $name, $this->data);
    }
707441
public function render(ResponseInterface $response, $name, array $context = [])
    {
        $this->assertFile($name);

        if (!$response->hasHeader('Content-Type')) {
            $response = $response->withHeader('Content-Type', 'text/html');
        }
        
        $body = $response->getBody();
        
        ob_start(function ($buffer) use ($body) {
            $body->write($buffer);
        });
        
        try {
            $this->runScript($name, $context);
        } finally {
            ob_end_clean();
        }
        
        return $response;
    }
1253344
protected function showBlock($name, $remove = true)
    {
        if (isset($this->block_content[$name])) {
            echo $this->block_content[$name];

            if ($remove) {
                unset($this->block_content[$name]);
            }
        }
    }
619404
public function renderByName($name)
    {
        $route = $this->getRoute($name);
        if (null === $route) {
            throw new RouteNotFoundException(sprintf('There is no route "%s".', $name));
        }

        $this->render($route, $name);
    }