Skip to content

Smarty plugin to dump any variable with symfony/var-dumper

License

Notifications You must be signed in to change notification settings

imponeer/smarty-debug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License GitHub release Maintainability PHP Packagist

Smarty Debug

This library provides some Smarty template plugins for adding new language keywords for debugging templates.

Installation

To install and use this package, we recommend to use Composer:

composer require imponeer/smarty-debug

Otherwise, you need to include manually files from src/ directory.

Registering in Smarty

If you want to use these extensions from this package in your project you need register them with registerPlugin function from Smarty. For example:

$smarty = new \Smarty();
$debugPrintVarModifierPlugin = new \Imponeer\Smarty\Extensions\Debug\DebugPrintVarModifier();
$smarty->registerPlugin('modifier', $debugPrintVarModifierPlugin->getName(), [$debugPrintVarModifierPlugin, 'execute']);

Using from templates

Debuging variables can be done from templates...

...with debug_print_var modifier:

{"_AD_INSTALLEDMODULES"|debug_print_var}

How to contribute?

If you want to add some functionality or fix bugs, you can fork, change and create pull request. If you not sure how this works, try interactive GitHub tutorial.

If you found any bug or have some questions, use issues tab and write there your questions.