2017 © Pedro PelĂĄez
 

library breakpoint-twig-extension

Twig extension to set breakpoints

image

ajgl/breakpoint-twig-extension

Twig extension to set breakpoints

  • Monday, November 20, 2017
  • by ajgarlag
  • Repository
  • 2 Watchers
  • 24 Stars
  • 509,892 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 41 % Grown

The README.md

AjglBreakpointTwigExtension

The AjglBreakpointTwigExtension component allows you set breakpoints in twig templates., (*1)

Build Status Latest Stable Version Latest Unstable Version Total Downloads Montly Downloads Daily Downloads License, (*2)

This component requires the Xdebug PHP extension to be installed., (*3)

Installation

To install the latest stable version of this component, open a console and execute the following command:, (*4)

composer require ajgl/breakpoint-twig-extension --dev

Usage

The first step is to register the extension into the twig environment, (*5)

/* @var $twig Twig_Environment */
$twig->addExtension(new Ajgl\Twig\Extension\BreakpointExtension());

Once registered, you can call the new breakpoint function:, (*6)

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>title</title>
  </head>
  <body>
    {{ breakpoint() }}
  </body>
</html>

Once stopped, your debugger will allow you to inspect the $environment and $context variables., (*7)

Function arguments

Any argument passed to the twig function will be added to the $arguments array, so you can inspect it easily., (*8)

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>title</title>
  </head>
  <body>
    {{ breakpoint(app.user, app.session) }}
  </body>
</html>

Symfony Bundle

The package includes a Symfony Bundle to automatically register the Twig extension., (*9)

If the app uses Symfony Flex and you allow the recipe execution, the bundle will be enabled automatically., (*10)

If you need to configure it manually, add the following line to the config/bundles.php file:, (*11)

// config/bundles.php
//...
return [
    //...
    Ajgl\Twig\Extension\SymfonyBundle\AjglBreakpointTwigExtensionBundle::class => ['dev' => true]
];

License

This component is under the MIT license. See the complete license in the LICENSE file., (*12)

Reporting an issue or a feature request

Issues and feature requests are tracked in the Github issue tracker., (*13)

Author Information

Developed with ♄ by Antonio J. GarcĂ­a Lagar., (*14)

If you find this component useful, please add a ★ in the GitHub repository page., (*15)

The Versions

20/11 2017

dev-master

9999999-dev https://github.com/ajgarlag/AjglBreakpointTwigExtension

Twig extension to set breakpoints

  Sources   Download

MIT

The Requires

 

The Development Requires

twig xdebug breakpoint

20/11 2017
26/10 2017
31/03 2016

0.3.0

0.3.0.0 https://github.com/ajgarlag/AjglBreakpointTwigExtension

Twig extension to set breakpoints

  Sources   Download

MIT

The Requires

 

The Development Requires

twig xdebug breakpoint

10/03 2016

0.2.0

0.2.0.0 https://github.com/ajgl/AjglTwigBreakpointExtension

Twig extension to set breakpoints

  Sources   Download

MIT

The Requires

 

The Development Requires

twig xdebug breakpoint

09/03 2016

0.1.0

0.1.0.0 https://github.com/ajgl/AjglTwigBreakpointExtension

Twig extension to set breakpoints

  Sources   Download

MIT

The Requires

 

twig xdebug breakpoint