You are here

README.txt in Twig Xdebug 8

CONTENTS OF THIS FILE
---------------------

 * Introduction
 * Requirements
 * Installation
 * Alternate Installation

INTRODUCTION
------------

This module enables you to use Xdebug breakpoints with Twig templates.

To use it, insert {{ breakpoint() }} into your template. When the processor
reaches that point, it makes a call to a Twig extension where xdebug_break() is
implemented.

The breakpoint will open in a file (BreakpointExtension.php) outside your Twig
template, but you'll be able to inspect any variables available at the
breakpoint in the template. The key values you'll see at the breakpoint are:

 - $context         These are the variables available to use in the template.
 - $environment     This is information about the Twig environment, including
                    available functions.
 - $arguments       If you supply an argument to breakpoint (e.g
                    {{ breakpoint(fields) }}), it'll be viewable here.

REQUIREMENTS
------------

This module requires the Composer package ajgl/breakpoint-twig-extension:

https://packagist.org/packages/ajgl/breakpoint-twig-extension

INSTALLATION
------------

On Drupal 8.1.x, install the module using CLI:

 1. Add the Drupal Packagist repository (if you haven't already):

  $ composer config repositories.drupal composer https://packages.drupal.org/8

 2. Require and install the module and its dependencies:

  $ composer require drupal/twig_xdebug

ALTERNATE INSTALLATION
----------------------

On Drupal 8.1.x, install the module manually:

 1. Add the git repository to your composer.json:

    "repositories": {
         ... other repos (if any) ...
         "drupal": {
             "type": "composer",
             "url": "https://packages.drupal.org/8"
         }
     }

 2. Require the module in your composer.json:

     "require": {
         ... other packages ...
         "drupal/twig_xdebug": "^1.0"
     },

 3. Install the module and its dependencies:

  $ composer update drupal/twig_xdebug


On Drupal 8.0.x, install the module using composer_manager:

 1. Download twig_xdebug

  $ drush dl twig_xdebug

 2. Download composer_manager

  $ drush dl composer_manager

  Note: You don't have to enable composer_manager to use it.

 3. Run the composer_manager init script

  $ php modules/contrib/composer_manager/scripts/init.php

 4. Rebuild your composer.json file

  $ composer drupal-rebuild

 5. Update to install dependencies

  $ composer update drupal/twig_xdebug

Learn more about using composer_manager here:

https://www.drupal.org/node/2405811

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Introduction
  4. * Requirements
  5. * Installation
  6. * Alternate Installation
  7. INTRODUCTION
  8. ------------
  9. This module enables you to use Xdebug breakpoints with Twig templates.
  10. To use it, insert {{ breakpoint() }} into your template. When the processor
  11. reaches that point, it makes a call to a Twig extension where xdebug_break() is
  12. implemented.
  13. The breakpoint will open in a file (BreakpointExtension.php) outside your Twig
  14. template, but you'll be able to inspect any variables available at the
  15. breakpoint in the template. The key values you'll see at the breakpoint are:
  16. - $context These are the variables available to use in the template.
  17. - $environment This is information about the Twig environment, including
  18. available functions.
  19. - $arguments If you supply an argument to breakpoint (e.g
  20. {{ breakpoint(fields) }}), it'll be viewable here.
  21. REQUIREMENTS
  22. ------------
  23. This module requires the Composer package ajgl/breakpoint-twig-extension:
  24. https://packagist.org/packages/ajgl/breakpoint-twig-extension
  25. INSTALLATION
  26. ------------
  27. On Drupal 8.1.x, install the module using CLI:
  28. 1. Add the Drupal Packagist repository (if you haven't already):
  29. $ composer config repositories.drupal composer https://packages.drupal.org/8
  30. 2. Require and install the module and its dependencies:
  31. $ composer require drupal/twig_xdebug
  32. ALTERNATE INSTALLATION
  33. ----------------------
  34. On Drupal 8.1.x, install the module manually:
  35. 1. Add the git repository to your composer.json:
  36. "repositories": {
  37. ... other repos (if any) ...
  38. "drupal": {
  39. "type": "composer",
  40. "url": "https://packages.drupal.org/8"
  41. }
  42. }
  43. 2. Require the module in your composer.json:
  44. "require": {
  45. ... other packages ...
  46. "drupal/twig_xdebug": "^1.0"
  47. },
  48. 3. Install the module and its dependencies:
  49. $ composer update drupal/twig_xdebug
  50. On Drupal 8.0.x, install the module using composer_manager:
  51. 1. Download twig_xdebug
  52. $ drush dl twig_xdebug
  53. 2. Download composer_manager
  54. $ drush dl composer_manager
  55. Note: You don't have to enable composer_manager to use it.
  56. 3. Run the composer_manager init script
  57. $ php modules/contrib/composer_manager/scripts/init.php
  58. 4. Rebuild your composer.json file
  59. $ composer drupal-rebuild
  60. 5. Update to install dependencies
  61. $ composer update drupal/twig_xdebug
  62. Learn more about using composer_manager here:
  63. https://www.drupal.org/node/2405811