![]() And flush all caches and reload your page, image below will appear in your page. Optionally, download and install the Devel Kint Extras module to search the nested variable list.Ksm() function prints kint() output in the message region. twig files, use kint() to inspect the variables just like dump() is described above while in php code, use ksm() instead. Like the dump function, kint() will not display any output unless debugging is enabled.Install the kint-php library (using composer: composer require kint-php/kint -dev).Download the devel module and install it.Here’s on how to enable or install kint() function: Instead, you get two new ones: kint and ksm which are more convenient in debugging your page. You can still use the dpm and dsm function in your debugging. Whereas, kint() function works exactly the same functionality as the dump() function, yet kint() provides an expandable and collapsible interface to the variables that it prints out and makes it easier to understand and debug.Īs mentioned above, Kint comes as a sub-module so it hasn’t replaced the old function dpm and dsm, these functions are still there. Twig’s dump() function will often print a lot of text to the web page making it difficult to find the needle you want amidst the haystack of text. Kint function is an alternative to dump() function. It allows you to print the variables in special Twig templates which have a user-friendly formatting for the information about objects and arrays provided. It is one of the submodules of the Devel Module - Devel Module is a fast and convenient way to start debugging.It injects its library to your project. Kint is a tool designed to present your debugging data in the absolutely best way possible. The way devel is build looks like it works without kint, but if you want to take full advangtage of the devel - kint combination while developing you should run an extra composer. In this case, we are going to completely split the configuration for Database Logging, Devel, Kint. In this video, youll learn about installing devel kint and on how to use it for basic debugging such as accessing form elements, adding classes, etcdrupal9. What is not clear when you start developing with drupal 8-9 and using the devel module is that you need the kint vendor php package too. Sooner or later, even the most experienced software engineers must detect bugs and fix them promptly. Add your development modules to the config split settings. Similar to working with other development tools, you need to think and work hard to fix your bugs. But if you are working in a large software company composed by many developers over the years, you need to be an expert in debugging the code.Īccording to, there is no one-size-fits-all bug-proofing plugin for Drupal. It is easy to debug the code and you can protect your project from most potential issues if you work independently. For an amateur developer, writing outstanding code is still immensely difficult to achieve and making it more perfect in your first time is nearly impossible.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |