I have created a custom block, as I want to add this layout to my current layout.
Following is my block:
<referenceContainer name="sidebar.main"> <block class="Vendor\ModuleName\Block\Frontend\Block" name="ucTntlZsQVjVytW4xjtfdypv9LTzRsFP" template="Vendor_ModuleName::myBlock.phtml"/> </referenceContainer>
I want to add this block to my current block for that I created following event:
Now how can I add this block to layout using PHP