2017 © Pedro Peláez
 

library twig-debugbar

A Twig extension to provide access to PHP Debug Bar's rendering functions.

image

smtgr14/twig-debugbar

A Twig extension to provide access to PHP Debug Bar's rendering functions.

  • Thursday, April 12, 2018
  • by Smtgr14
  • Repository
  • 1 Watchers
  • 0 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 108 % Grown

The README.md

Twig Debug Bar

A simple Twig extension to provide rendering functions for the PHP Debug Bar. This extension loads the StandardDebugBar and provides the functions dbg_message, dbg_renderHead, and dbg_render for Twig., (*1)

Requirements:, (*2)

Installation

composer require smtgr14/twig-debugbar

Example

$twig = new Twig_Environment(new Twig_Loader_Filesystem('Views'));
$debugbarExtn = $debugbarExtn = new Dougfelton\TwigDebugBar\Extension('/Path'); // Relative assets path to your web directory e.g. /assets/debug/
$twig->addExtension($debugbarExtn);

$debugbar = $debugbarExtn->getDebugBar(); // Returns DebugBar for use with normal debugbar operations.
<html>
    <head>
        {{ dbg_renderHead() }}
    </head>
    <body>
        <!-- array dump -->
        {{ dbg_message(array)|raw }}
        <!-- labeled message -->
        {{ dbg_message('Something Wrong', 'error')|raw }}
        {{ dbg_render()|raw }}
    </body>
</html>

Acknowledgement

This extension is a minor update (for compatibility with Twig v2) of Mark Arneman's extension found here and the changes made by Doug Felton.
My work was minimal, and if you find this extension useful the credit goes to Mark and Doug. All I added was the getDebugBar method to return the object to make the bar useful outside of just the template rendering and message methods., (*3)

The Versions

12/04 2018

dev-dbb-twig-bridge

dev-dbb-twig-bridge

A Twig extension to provide access to PHP Debug Bar's rendering functions.

  Sources   Download

MIT

The Requires

 

by Samuel Inman

twig extension php debug bar

09/03 2018

dev-master

9999999-dev

A Twig extension to provide access to PHP Debug Bar's rendering functions.

  Sources   Download

MIT

The Requires

 

by Samuel Inman

twig extension php debug bar

09/03 2018

1.1.0

1.1.0.0

A Twig extension to provide access to PHP Debug Bar's rendering functions.

  Sources   Download

MIT

The Requires

 

by Samuel Inman

twig extension php debug bar

15/01 2017

1.0.0

1.0.0.0

A Twig extension to provide access to PHP Debug Bar's rendering functions.

  Sources   Download

MIT

The Requires

 

twig extension php debug bar