2017 © Pedro Peláez
 

yii2-extension yii2-ajax-debugger

Handy developer tool for debugging AJAX requests in web browser

image

strider2038/yii2-ajax-debugger

Handy developer tool for debugging AJAX requests in web browser

  • Sunday, February 26, 2017
  • by strider2038
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Yii2 Ajax debugger

Installation

Either run, (*1)

$ php composer.phar require strider2038/yii2-ajax-debugger "*"

or add, (*2)

"strider2038/yii2-ajax-debugger": "*"

to the require section of your composer.json file., (*3)

About

This tool is based on JSONBeautifyIt function for formatting JSON/JSONP data. DebugDetector component can intercept JSON or JSONP responses from server and format them as html document. After rendering JSON data JSONBeautifyIt function is applied for beautifying rendered data array. Be aware of using this component in production mode., (*4)

To set up this component for work you should add this lines to your web config file, (*5)

$config = [
     // this is needed to initialize component on app load
     'bootstrap' => ['ajaxDebugger', ...], 
     'components' => [
         'ajaxDebugger' => [
             'class' => 'strider2038\ajaxdebugger\DebugDetector',
             // conditions for enabling debug mode
             'enabled' => YII_ENV_DEV && !empty($_GET['_debug']),
         ],
         ...
     ],
     ...
];

After that you can open pages with AJAX or API responses in browser. If you add GET parameter _debug=1 you will see parsed JSON data and debug panel as on other html pages., (*6)

Yii2 Ajax debugger example, (*7)

You can see working examples in my Yii2 template - https://github.com/strider2038/yii2-template/blob/master/controllers/AjaxController.php, (*8)

The Versions

26/02 2017

dev-master

9999999-dev

Handy developer tool for debugging AJAX requests in web browser

  Sources   Download

MIT

The Requires

 

by Avatar strider2038

debug extension yii2 ajax developer tool developing

26/02 2017

1.0.0

1.0.0.0

Handy developer tool for debugging AJAX requests in web browser

  Sources   Download

MIT

The Requires

 

by Avatar strider2038

debug extension yii2 ajax developer tool developing