UIContentBlock: Add PrependSubBlock() to add a block in first position

This commit is contained in:
Molkobain
2021-04-20 16:30:13 +02:00
parent d1ccd5c8eb
commit d2c4a6e2e9

View File

@@ -71,6 +71,19 @@ class UIContentBlock extends UIBlock implements iUIContentBlock
return $this;
}
/**
* Add $oSubBlock as the first of the sub blocks, while preserving the array indexes
*
* @param \Combodo\iTop\Application\UI\Base\iUIBlock $oSubBlock
*
* @return $this
*/
public function PrependSubBlock(iUIBlock $oSubBlock)
{
$this->aSubBlocks = [$oSubBlock->GetId() => $oSubBlock] + $this->aSubBlocks;
return $this;
}
/**
* @inheritDoc
*/