You are here

public function Twig_Template::hasBlock in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/Template.php \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.

@internal

Parameters

string $name The block name:

Return value

bool true if the block exists, false otherwise

File

vendor/twig/twig/lib/Twig/Template.php, line 253

Class

Twig_Template
Default base class for compiled templates.

Code

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