Git Product home page Git Product logo

timber-debugger's Introduction

Timber Debugger

Package which provides some extra debugging options for Timber

Installation

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

composer require djboris88/timber-debugger

Usage

These extensions are only active when WP_DEBUG is defined and set to true. Twig Extensions will automatically be registered and applied.

Commented Include

Package: djboris88/twig-commented-include (GitHub, Packagist)

This is a simple Twig Extension which helps debugging and navigating through many Twig partials in your project. It outputs a HTML comments before and after each include statement while rendering the template. Comments look like this:

<!-- Begin output of "_partials/_navigation.twig" -->
<div class="navigation" role="navigation" data-navigation>...</div>
<!-- / End output of "_partials/_navigation.twig" -->

Dump extension

Package: hellonico/twig-dump-extension (GitHub, Packagist)

Standalone Symfony Var Dumper Twig extension. Add {{ dump() }} in your twig templates to see it in action.

{{ dump(foo) }}
{% dump foo %}
{% dump foo, bar %}

Twig Breakpoints

Package : ajgl/breakpoint-twig-extension (GitHub, Packagist)

This component allows you set breakpoints in twig templates.
Requires the Xdebug PHP extension to be installed.

<!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.

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

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

License

This component is under the GPL 3.0 license. See the complete license in the LICENSE file.

Reporting an issue or a feature request

Issues and feature requests are tracked in the Github issue tracker.

Author Information

Developed with ♥ by Boris Đemrovski.

If you find this component useful, please add a ★ in the GitHub repository page and/or the Packagist package page.

timber-debugger's People

Contributors

djboris88 avatar arnaudritti avatar boris-djemrovski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.