mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°3565 - Migrate backoffice pages to new UIBlock system : Setup
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user