N°3565 - Migrate backoffice pages to new UIBlock system : Setup

This commit is contained in:
Eric
2021-02-01 16:28:10 +01:00
parent 664dd12241
commit 2f68be14f8
16 changed files with 756 additions and 248 deletions

View File

@@ -15,6 +15,28 @@ use WebPage;
class ConsoleBlockRenderer extends BlockRenderer
{
/**
* Add blocks to the page using twig template
* @param \WebPage $oPage
* @param \Combodo\iTop\Application\UI\Base\iUIBlock $oBlock UIBlock containing template using UIBlock tags
* @param array $aContextParams
*
* @throws \ReflectionException
* @throws \Twig\Error\LoaderError
* @throws \Twig\Error\RuntimeError
* @throws \Twig\Error\SyntaxError
*/
public static function PreRenderBlockIntoPage(WebPage $oPage, iUIBlock $oBlock, array $aContextParams = [])
{
static::AddCssJsToPage($oPage, $oBlock, $aContextParams);
$aContextParams['UIBlockParent'] = [$oPage];
$aContextParams['oPage'] = $oPage;
$oSelf = new static($oBlock, $aContextParams);
// No output will add blocks to the page
$oSelf->RenderHtml();
}
/**
* Helper to use directly in TWIG to render a block and its sub blocks
*