This addon extends Cockpit CMS (Next) core by providing debug functionality based on the Kint PHP Library.
Installation can be performed with or without php composer (But keep in mind that after downloaded/extracted the addon must be named Kint).
- Download zip and extract to 'your-cockpit-docroot/addons/Kint' (e.g. cockpitcms/addons/Kint)
- Install Kint dependency using composer
$ cd your-cockpit-docroot/addons/Kint
$ composer install
- Install addon using composer
$ cd your-cockpit-docroot/addons
$ composer create-project pauloamgomes/cockpit-cms-kint Kint
No configuration is required.
The Cockpit Kint is a developer addon, to be used for example when implementing your own addons, there are two basic methods:
- Dump - will dump the variables to the screen
$this->app->module('kint')->dump($var1, $var2, ...);
- Console - will dump the variables to the browser console
$this->app->module('kint')->console($var1, $var2, ...);
If the debug functions are called during an API request, the output will be logged using the HTTP headers instead:
Copyright 2018 pauloamgomes under the MIT license.