Returns whether a block exists or not.
This method is for internal use only and should never be called directly.
This method does only return blocks defined in the current template or defined in "used" traits.
It does not return blocks from parent templates as the parent template name can be dynamic, which is only known based on the current context.
string $name The block name:
Boolean true if the block exists, false otherwise
public function hasBlock($name) {
return isset($this->blocks[(string) $name]);
}