public function Twig_Template::hasBlock

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.

Parameters

string $name The block name:

Return value

Boolean true if the block exists, false otherwise

File

drupal/core/vendor/twig/twig/lib/Twig/Template.php, line 198

Class

Twig_Template
Default base class for compiled templates.

Code

public function hasBlock($name) {
  return isset($this->blocks[(string) $name]);
}