Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

pauloamgomes/cockpit-cms-kint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cockpit CMS Kint Addon

This addon extends Cockpit CMS (Next) core by providing debug functionality based on the Kint PHP Library.

Installation

Installation can be performed with or without php composer (But keep in mind that after downloaded/extracted the addon must be named Kint).

Without php composer

  1. Download zip and extract to 'your-cockpit-docroot/addons/Kint' (e.g. cockpitcms/addons/Kint)
  2. Install Kint dependency using composer
$ cd your-cockpit-docroot/addons/Kint
$ composer install

Using php composer

  1. Install addon using composer
$ cd your-cockpit-docroot/addons
$ composer create-project pauloamgomes/cockpit-cms-kint Kint

Configuration

No configuration is required.

Usage

The Cockpit Kint is a developer addon, to be used for example when implementing your own addons, there are two basic methods:

  1. Dump - will dump the variables to the screen
$this->app->module('kint')->dump($var1, $var2, ...);

Dump Example

  1. Console - will dump the variables to the browser console
$this->app->module('kint')->console($var1, $var2, ...);

Console Example

If the debug functions are called during an API request, the output will be logged using the HTTP headers instead:

Headers

Copyright and license

Copyright 2018 pauloamgomes under the MIT license.