You are here

public function TwigExtension::drupalBreakpoint in Twig Tweak 8.2

Emits a breakpoint to the debug client.

Parameters

\Twig_Environment $environment: The Twig environment instance.

array $context: Variables from the Twig template.

File

src/TwigExtension.php, line 1005

Class

TwigExtension
Twig extension with some useful functions and filters.

Namespace

Drupal\twig_tweak

Code

public function drupalBreakpoint(\Twig_Environment $environment, array $context) {
  if (function_exists('xdebug_break')) {
    xdebug_break();
  }
  else {
    trigger_error('Could not make a break because xdebug is not available.', E_USER_WARNING);
  }
}