Skip to content

Extends the "Kint Debugger" plugin for Wordpress to provide a Twig filter for Timber

Notifications You must be signed in to change notification settings

wonkeythemonkey/kint-debugger-for-timber

Repository files navigation

Kint Debugger for Timber

Adds Timber support to the Kint Debugger plugin for Wordpress.

Requires a theme with Timber installed, either as a plugin (prior to version 2.0) or via composer (recommended).

It also works best when combined with Debug Bar. See the main Kint Debugger plugin page for details.

Basic Usage

{{ variable_name|kint($inline) }}

Apply the filter to variable (usually a Twig object or array) within a .twig file that is being rendered by Timber.

Example:

{{ variable_name|kint }}

This will put a variable dump inline in the rendered HTML wherever you inserted the filter.

With Debug Bar

By default, when Debug Bar is installed and active, Kint Debugger (and by extension this plugin) will send output to the "Kint Debugger" Debug Bar panel.

If you would like to override this behavior and instead dump the variable inline, pass true to the $inline argument:

Example:

{{ post|kint(true) }}

Alternative Syntax

If you regularly use kint directly in PHP, you are probably used to calling the d() function to generate dumps. If it is easier for you to remember, you can also use |d() in Kint for Timber as an alias for |kint()

About

Extends the "Kint Debugger" plugin for Wordpress to provide a Twig filter for Timber

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages