I want to create a block dynamically but not render it within the layout hierarchy (I am going to save the output).
Is there any reason to use
Layout::createBlock() in this case or can I instantiate it directly with a factory? Or even inject the block itself as shared instance into the class where I'm using it?
I would prefer to avoiding the unnecessary dependency to the layout and the additional abstraction but I am not sure what might break if the block is not associated to the layout.