![]() ![]() In this tutorial, we showed you how you can use the Devel and the Devel Kint Extras modules to print variables within your custom module (PHP) and also in your theme (Twig). I won’t cover it in this tutorial, but read this documentation page on to learn how to do it. To do this go to: admin/config/development/develĪnd select Kint Extender and Save the configuration as shown below:įor this to work, you must turn on Twig debugging. We can now enable both devel and devel_kint_extras with just one Drush command: drush en devel_kint_extras -yįinally, we have to enable Kint Extended as the Variables Dumper. We can install both using Composer: composer require drupal/devel drupal/devel_kint_extras To get started go and download the Devel and Devel Kint Extras module.ĭevel Kint Extras ships with the kint-php library so installing this via Composer will take care of it automatically. This tutorial will walk through how to set up these modules so you can print variables in PHP and Twig using Kint. Using Devel and the Devel Kint Extras modules, you can print variables in a more user-friendly way. In most cases, it prints too much information and it can be time-consuming to find the variable you actually want by filtering through all the arrays and methods. PHP has default functions such as var_dump() and print_r() that will print all the information but it’s not very intuitive nor printed in an easy to understand way. ![]() As a Drupal developer, you will often want to inspect variables in your modules or themes to view the actual values. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |