Renders the "Usage" section.

@param BlockLayout $layout      The layout.
@param Application $application The application to describe.
@param ArgsFormat  $argsFormat  The format of the console arguments.
168228
protected function renderUsage(BlockLayout $layout, Application $application, ArgsFormat $argsFormat)
    {
        $appName = $application->getConfig()->getName();

        $layout->add(new Paragraph('<b>USAGE</b>'));
        $layout->beginBlock();

        $this->renderSynopsis($layout, $argsFormat, $appName);

        $layout->endBlock();
        $layout->add(new EmptyLine());
    }
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;
    }
773776
function ReportLayoutAction(Layout $layout, Enums\Action $action)
    {
        $logItem = $this->CreateLogItem(Enums\ObjectType::Layout(), $action);       
        if (!$action->Equals(Enums\Action::Delete()))
        {
            $logLayout = new LogLayout();
            $logLayout->SetLogItem($logItem);
            $logLayout->SetLayout($layout);
            $logLayout->Save();
        }
        else
        {
            //pages are deleted in cascade
            $pages = Page::Schema()->FetchByLayout(false, $layout);
            foreach ($pages as $page)
            {
                $this->ReportPageAction($page, Enums\Action::Delete());
            }
        }
    }
416868
protected function renderContent(Content $content, $viewType, $layout = false, array $params = array())
    {
        return $this->viewManager->renderContent($content, $viewType, $params + array('noLayout' => !$layout));
    }
898715
public function setup_blocks($pagelayout, $blockmanager) {
        $layoutinfo = $this->layout_info_for_page($pagelayout);
        if (!empty($layoutinfo['regions'])) {
            $blockmanager->add_regions($layoutinfo['regions'], false);
            $blockmanager->set_default_region($layoutinfo['defaultregion']);
        }
    }
501576
private function renderRow(array $row, $cellFormat) {
        if (empty($row)) {
            return;
        }

        $rowContent = $this->renderColumnSeparator();
        foreach ($this->getRowColumns($row) as $column) {
            $rowContent .= $this->renderCell($row, $column, $cellFormat);
            $rowContent .= $this->renderColumnSeparator();
        }
        $this->output->writeln($rowContent);
    }
47046
public function ofWithLayout($view, $args = array(), $type = null)
    {
        $view = $this->getLayoutName().'.'.$view;

        return $this->of($view, $args, $type);
    }
1109984
public function setLayout($layout = null)
    {
        if (null !== $layout && !is_string($layout) && !($layout instanceof ViewModel)) {
            throw new InvalidArgumentException(
                'Invalid value supplied for setLayout.'.
                'Expected null, string, or Zend\View\Model\ViewModel.'
            );
        }

        if (null === $layout && empty($this->config['message']['layout'])) {
            return;
        }

        if (null === $layout) {
            $layout = (string) $this->config['message']['layout'];

            unset($this->config['message']['layout']);
        }

        if (is_string($layout)) {

            $template   = $layout;
            $layout     = new ViewModel;

            $layout->setTemplate($template);
        }

        $this->layout = $layout;
    }
911765
private function askForMappingFormat(InputInterface $input, OutputInterface $output, QuestionHelper $dialog)
    {
        $format = $input->getOption('format');
        $output->writeln(array(
            '',
            'Determine the format to use for the generated CRUD.',
            '',
        ));
        $question = new Question($dialog->getQuestion('Configuration format (yml, xml, php, or annotation)', $format), $format);
        $question->setValidator(array(
            'Sensio\Bundle\GeneratorBundle\Command\Validators',
            'validateFormat',
        ));

        $format = $dialog->ask($input, $output, $question);
        $input->setOption('format', $format);

        return $format;
    }
1022731
public static function renderBlocks($name, $args = array())
    {
        global $PPHP, $_SESSION;

        array_merge_assoc(
            self::$_stash,
            $args,
            array(
                'config' => $PPHP['config'],
                'session' => $_SESSION,
                'req' => grab('request')
            )
        );
        try {
            $template = self::$_twig->loadTemplate($name);
            $blockNames = $template->getBlockNames(self::$_stash);
            $results = array();
            foreach ($blockNames as $blockName) {
                $results[$blockName] = $template->renderBlock($blockName, self::$_stash);
            };
        } catch (\Exception $e) {
            echo $e->getMessage();
        };
        return $results;
    }
900268
static function LayoutTemplate(Layout $layout)
    {
        $folder = Path::Combine(PHINE_PATH, 'App/Phine/LayoutTemplates');
        $file = Path::Combine($folder, $layout->GetName());
        return Path::AddExtension($file, 'phtml');
    }
673042
protected function initializeLayout(FieldsBuilder $layout, $args = [])
    {
        $layout->setGroupConfig('name', $layout->getName());
        $layout->setGroupConfig('display', 'block');

        foreach ($args as $key => $value) {
            $layout->setGroupConfig($key, $value);
        }

        $layout->setParentContext($this);

        return $layout;
    }
566663
protected function renderOptions(BlockLayout $layout, array $options)
    {
        $layout->add(new Paragraph('<b>OPTIONS</b>'));
        $layout->beginBlock();

        foreach ($options as $option) {
            $this->renderOption($layout, $option);
        }

        $layout->endBlock();
        $layout->add(new EmptyLine());
    }
716913
public function displayZone(Layout $layout, string $zoneIdentifier, string $viewContext, ContextualizedTwigTemplate $twigTemplate): void
    {
        $locales = null;

        $request = $this->requestStack->getCurrentRequest();
        if ($request instanceof Request) {
            $locales = $this->localeProvider->getRequestLocales($request);
        }

        $zone = $layout->getZone($zoneIdentifier);
        $linkedZone = $zone->getLinkedZone();

        $blocks = $this->blockService->loadZoneBlocks(
            $linkedZone instanceof Zone ? $linkedZone : $zone,
            $locales
        );

        echo $this->renderValue(
            [],
            new ZoneReference($layout, $zoneIdentifier),
            [
                'blocks' => $blocks,
                'twig_template' => $twigTemplate,
            ],
            $viewContext
        );
    }
460881
private function mergeLayout( array $layoutA, array $layoutB )
    {
        $blocksA = empty( $layoutA['blocks'] ) ? [] : $layoutA['blocks'];
        $blocksB = empty( $layoutB['blocks'] ) ? [] : $layoutB['blocks'];

        $cssA = empty( $layoutA['css'] ) ? [] : $layoutA['css'];
        $cssB = empty( $layoutB['css'] ) ? [] : $layoutB['css'];

        return [
            'template' => empty( $layoutB['template'] ) ? ( empty( $layoutA['template'] ) ? '1column' : $layoutA['template'] ) : $layoutB['template'],
            'css' => array_merge( $cssA, $cssB ),
            'blocks' => $this->mergeLayoutBlocks( $blocksA, $blocksB )
        ];
    }
272567
public static void log(String format, Object...args) {
    System.out.println(String.format(format, args));
  }
1205526
private function renderPage($layoutFile = null, $params = null)
    {
        $this->setNode($this->getObject());

        $application = $this->getApplication();
        // Rendering subcontent
        if (null !== $contentSet = $this->getObject()->getContentSet()) {
            $bbUserToken = $application->getBBUserToken();
            $revisionRepo = $application->getEntityManager()->getRepository('BackBee\ClassContent\Revision');
            if (null !== $bbUserToken && null !== $revision = $revisionRepo->getDraft($contentSet, $bbUserToken)) {
                $contentSet->setDraft($revision);
            }

            $layout = $this->getObject()->getLayout();
            $zones = $layout->getZones();
            $zoneIndex = 0;

            foreach ($contentSet->getData() as $content) {
                if (array_key_exists($zoneIndex, $zones)) {
                    $zone = $zones[$zoneIndex];
                    $isMain = null !== $zone && property_exists($zone, 'mainZone') && true === $zone->mainZone;
                    $this->container()->add($this->render($content, $this->getMode(), array(
                        'class' => 'rootContentSet',
                        'isRoot' => true,
                        'indexZone' => $zoneIndex++,
                        'isMainZone' => $isMain,
                    ), null, $this->_ignoreIfRenderModeNotAvailable));
                }
            }
        }

        // Check for a valid layout file
        $this->templateFile = $layoutFile;
        if (null === $this->templateFile) {
            $this->templateFile = $this->getLayoutFile($this->getCurrentPage()->getLayout());
        }

        if (!$this->isValidTemplateFile($this->templateFile, true)) {
            throw new RendererException(
                sprintf('Unable to read layout %s.', $this->templateFile), RendererException::LAYOUT_ERROR
            );
        }

        $application->info(sprintf('Rendering page `%s`.', $this->getObject()->getNormalizeUri()));

        return $this->renderTemplate(false, true);
    }