Renders the component for the HTML template.

@param string $layout Page layout passed from template.
@param string $title Page title passed from template.

@return DBHTMLText|string
184398
public function renderSelf($layout = null, $title = null)
    {
        if ($this->hasSourceComponent()) {
            
            $source = $this->SourceComponent();
            
            if ($this->StyleID) {
                $source->StyleID = $this->StyleID;
            }
            
            $source->loadRequirements();
            
        }
        
        return parent::renderSelf($layout, $title);
    }
653248
public function renderView($viewPath = null, $data = [], $layout = null)
    {
        ob_start();
        require($viewPath);
        $viewData = ob_get_contents();
        ob_end_clean();
        foreach($data as $key => $val) {
            if(is_array($val)) {
                if($key == 'meta') {
                    $this->data['meta'] = $val;
                }
            }
            else {
                $viewData = str_replace('{{'.$key.'}}', $val, $viewData);
            }
        }
        return $viewData;
    }
835543
public function setLayout($layout)
    {
        $extensions = ['.php', '.phtml', '.html', '.tpl'];

        if (isset($this->presets[ 'extensions' ])) {
            array_unshift($partialsExtensions, $this->presets[ 'extension' ]);
        } elseif (isset($this->presets[ 'extension' ])) {
            array_unshift($extensions, $this->presets[ 'extension' ]);
        }

        foreach ($extensions as $extension) {
            $extension = trim($extension, '.');

            if ($layout === 'theme') {
                $layoutFilePath = $this->getRealPath() . 'theme.' . $extension;
            } else {
                $layoutFilePath = $this->getRealPath() . 'layouts' . DIRECTORY_SEPARATOR . dash($layout) . DIRECTORY_SEPARATOR . 'layout.' . $extension;
            }

            if (is_file($layoutFilePath)) {
                $this->layout = new Theme\Layout($layoutFilePath);
                //$this->loadLayout();
                break;
            }
        }

        return $this;
    }
288063
public function viewContent($layout, $data = array())
    {
        $data = array_merge($data, array('body' => array(
            'attributes' => array('class' => static::$tplPrefixClass.str_replace('::', '-', $layout))
        )));

        return $this->layout->content = View::make($layout, $this->getCommonVars($data));
    }
543944
public function renderContent($layout)
    {
        $tmp = ' '; // void in case of not yet content

        if (isset($layout['content']) && isset($layout['type']) && is_array($layout['content'])) {
            foreach ($layout['content'] as $content) {
                $tmp .= $this->render(
                    'ClarolineCoreBundle:home/types:'.$content['type'].'.html.twig', $content, true
                )->getContent();
            }
        }

        $layout['content'] = $tmp;

        return $layout;
    }
364376
public function render($response, $layout, $values=array()) {
		$this->fillValues($values);
		$response->collectFrom($layout, $values);
		return $response;
	}
866251
public function render($view = null, $layout = null)
    {
        $content = parent::render($view, $layout);
        if ($this->response->type() == 'text/html') {
            return $content;
        }

        $this->Blocks->set('content', $this->output());
        $this->response->download($this->getFilename());

        return $this->Blocks->get('content');
    }
764162
public function compile($layout = true)
    {
        $code = $this->trim($this->source);
        $buffer = '';
        $open = array();
        
        Tokenizer::i($code)->tokenize(function ($node) use (&$buffer, &$open) {
            switch ($node['type']) {
                case Tokenizer::TYPE_TEXT:
                    $buffer .= $this->generateText($node, $open);
                    break;
                case Tokenizer::TYPE_VARIABLE_ESCAPE:
                    $buffer .= $this->generateEscape($node, $open);
                    break;
                case Tokenizer::TYPE_VARIABLE_UNESCAPE:
                    $buffer .= $this->generateVariable($node, $open);
                    break;
                case Tokenizer::TYPE_SECTION_OPEN:
                    $buffer .= $this->generateOpen($node, $open);
                    break;
                case Tokenizer::TYPE_SECTION_CLOSE:
                    $buffer .= $this->generateClose($node, $open);
                    break;
            }
        });
        
        //START: This is more to help troubleshooting
        if (count($open)) {
            foreach ($open as $i => $item) {
                $open[$i] = sprintf(self::ERROR_LINE, $item['value'], $item['line']);
            }

            throw new Exception(sprintf(self::ERROR_MISSING_CLOSING, implode(self::ERROR_AND, $open)));
        }
        //END: This is more to help troubleshooting
        
        if (!$layout) {
            return $buffer;
        }

        return sprintf(self::$layout, $buffer);
    }
29103
protected function setupLayout($layout = null)
    {
        $this->layout = !is_null($layout) ? $layout : $this->layout;
        if ($this->layout && is_string($this->layout) && view()->exists($this->layout)) {
            $this->layout = view($this->layout);
        }
    }
1030180
public function render(string $layout = null, array $context = [])
    {
        if (null === $layout) {
            $layout = 'default';
        }

        $grav = Grav::instance();

        $block = HtmlBlock::create();
        $block->disableCache();

        $output = $this->getTemplate($layout)->render(
            ['grav' => $grav, 'config' => $grav['config'], 'block' => $block, 'form' => $this, 'layout' => $layout] + $context
        );

        $block->setContent($output);

        return $block;
    }
274341
public function create($template = null)
    {
        if (null !== $template) {
            $this->setScriptName($template);
        }

        $this->layout->assign('content', $this->layout->getView()->render($this->getScript()));
        return $this->layout->render();
    }
55928
public function renderContent($content, $title = null)
    {
        if ($content instanceof Renderable) {
            $content = $content->render();
        }

        return $this->admin->template()->view('_layout.inner')
            ->with('title', $title)
            ->with('content', $content)
            ->with('breadcrumbKey', $this->parentBreadcrumb);
    }
560698
protected function FormUrl(Layout $layout = null)
    {
        
        $args = array();
        if ($layout)
        {
            $args['layout'] = $layout->GetID();
        }
        return BackendRouter::ModuleUrl(new LayoutForm(), $args);
    }
1067175
public function getTranslatedLayout($layout)
    {
        $template = $this->layoutLoader->load($layout);
        $template = TranslationUtil::translateLayout($template, $this->getTemplater()->getLocale(), $this->translator);

        if (!$template instanceof TwigLayout) {
            $msg = 'The "%s" layout is not a twig layout';

            throw new InvalidArgumentException(sprintf($msg, $layout));
        }

        return $template;
    }
908841
public function toRender($title, $crud, $data)
    {
        $view       = $this->di->get("view");
        $pageRender = $this->di->get("pageRender");
        $view->add($crud, $data);
        $tempfix = "";
        $pageRender->renderPage($tempfix, ["title" => $title]);
    }
779853
public function createLayout(Layout $layout): Layout
    {
        $query = $this->connection->createQueryBuilder()
            ->insert('ngbm_layout')
            ->values(
                [
                    'id' => ':id',
                    'status' => ':status',
                    'type' => ':type',
                    'name' => ':name',
                    'description' => ':description',
                    'created' => ':created',
                    'modified' => ':modified',
                    'shared' => ':shared',
                    'main_locale' => ':main_locale',
                ]
            )
            ->setValue(
                'id',
                $layout->id !== null ?
                    (int) $layout->id :
                    $this->connectionHelper->getAutoIncrementValue('ngbm_layout')
            )
            ->setParameter('status', $layout->status, Type::INTEGER)
            ->setParameter('type', $layout->type, Type::STRING)
            ->setParameter('name', $layout->name, Type::STRING)
            ->setParameter('description', $layout->description, Type::STRING)
            ->setParameter('created', $layout->created, Type::INTEGER)
            ->setParameter('modified', $layout->modified, Type::INTEGER)
            ->setParameter('shared', $layout->shared, Type::BOOLEAN)
            ->setParameter('main_locale', $layout->mainLocale, Type::STRING);

        $query->execute();

        $layout->id = $layout->id ?? (int) $this->connectionHelper->lastInsertId('ngbm_layout');

        return $layout;
    }
604092
protected function renderContent($layout = true)
    {
        if (isset($this->content)) {
            return $this->content;
        }
        if (is_null(Yii::$app->controller) && !is_null($this->controller)) {
            Yii::$app->controller = $this->controller;
        }
        if (is_null(Yii::$app->controller->action) && !is_null($this->action)) {
            Yii::$app->controller->action = $this->action;
        }
        if (isset($this->controller) && $this->view) {
            $this->controller->params = array_merge($this->controller->params, $this->params);
            if ($layout) {
                return $this->controller->render($this->view);
            } else {
                return $this->controller->renderPartial($this->view);
            }
        }

        return;
    }