Statistics
161
1
0
1.8y
Badges
Dependencies

LeonardoCA/Tools Build Status

Various tools for debugging nette applications:

  • SmartDump
  • htmlDump
  • ProcessMonitor
  • DumpMailer

Installation

The best way to install LeonardoCA/Tools is using Composer:

composer require leonardoca/tools:@dev

Configure extension in config.ini

extensions:
	smartDump: LeonardoCA\Tools\DI\SmartDumpExtension
smartDump:
	traceMode: 2  #false|number|all

Usage

Fast smart dump to Tracy Bar Panel

	SmartDump::dump($variable);

	// shortcut
	sdump($variable);

	// add own html block to dump panel

	SmartDump::addToDumpPanel(
		'
		<table>
			<tr><th>A</th><th>B</th><th>C</th><th>D</th></tr>
			<tr><td>1</td><td>2</td><td>3</td><td>4</td></tr>
		</table>
		',
		'custom info'
	);

	// catching output buffering to dumps panel

	bs();
	echo "some output to browser";
	be('catch output buffering');

	// tidy formatted output

	$someXML =
		'<?xml version="1.0" encoding="utf-8"?><something>jjj</something>
<otherwise><x1>88</x1><x2>44</x2></otherwise>';

	sdump(tidyFormatXML($someXML));

	SmartDump::addToDumpPanel(
		'<pre>' . htmlspecialchars(tidyFormatXML($someXML)) . '</pre>',
		"some XML"
	);

	// dumpHtml for fast debugging of html markup of Nette\Utils\Html or whole Controls

	$someHtmlObject =
		Nette\Utils\Html::el('a')->addClass('btn btn-danger')->setTitle(
			'Danger'
		)->setHtml('danger');

	dumpHtml($someHtmlObject);

No release at this moment. Try to create first one.

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette admin@componette.com