It would be very useful extend the devel functionalities and provide Twig debug functions that use the pluggable dumper system even for debug twig. In this way every external libraries for which exist a dumper plugin (adapter) can be used for debug twig with no development/impact.
The idea is:
Create functions for dump twig variables (like currently kint()
does)
{{ devel_dump() }}
{{ kpr() }}
Create functions for set message with the dumped variables (ala dpm()
)
{{ devel_message() }}
{{ dpm() }}
{{ dsm() }}
Some other modules may benefit from this initiative and colud provide valid alternatives to debug twig with kint :)
- Vardumper - see https://www.drupal.org/project/vardumper
- Ladybug - WIP see #2707967: Add support for Devel dumper system
Comment | File | Size | Author |
---|---|---|---|
#6 | interdiff.txt | 9.08 KB | willzyx |
#6 | dumper_system_part_ii-2725395-6.patch | 16.14 KB | willzyx |
#5 | interdiff.txt | 900 bytes | willzyx |
#5 | dumper_system_part_ii-2725395-5.patch | 14.66 KB | willzyx |
| |||
#3 | interdiff.txt | 9.22 KB | willzyx |
Comments
Comment #2
willzyx CreditAttribution: willzyx commentedComment #3
willzyx CreditAttribution: willzyx commentedAdded test coverage
Comment #5
willzyx CreditAttribution: willzyx commentedseems that
DoctrineDebug::export()
andDoctrineDebug::dump()
produce a very different outputComment #6
willzyx CreditAttribution: willzyx commentedIMHO we should make DoctrineDebug::dump() output (use
var_dump()
) more similar to the DoctrineDebug::export() output (useprint_r()
) or at least allow HTML tags in dump for take advantage of Xdebug (if enabled) var_dump() implementation. Change DoctrineDebug::dump() in this issue seems to be out of scope so revertedWe need different functions for test
{{ devel_dump() }}
and{{ devel_message() }}
since the first internally useDevelDumperManager::dump()
while the secondDevelDumperManager::export()
Comment #7
willzyx CreditAttribution: willzyx commentedIf no one have objections/suggestions I'm going to commit this in the next few days
Comment #8
dawehnerJust stumbled upon this issue. Really great work! No objections, this is for sure.
this is a super nice idea, as it leads to less broken deployments
Comment #9
lussolucaGreat work! RTBC for me
https://www.drupal.org/project/vardumper already works with the new plugin infrastructure
Comment #11
willzyx CreditAttribution: willzyx commentedCommitted and pushed to 8.x