Type
magento2-module
Magento with Symfony VarDumper replacement to Zend_Debug
magento2-module
proprietary
None
None
None
None
None
Magento with Symfony VarDumper replacement to Zend_Debug
composer require dominicwatts/magentodump
php bin/magento setup:upgrade
Go to /xigen_magentodump/index/dump
to see some of the possibilities
composer require symfony/var-dumper
Can be used as part of a class
use Symfony\Component\VarDumper\VarDumper;
/**
* Class Dump
* @package Xigen\MagentoDump\Block\Index
*/
class Dump extends \Magento\Framework\View\Element\Template
{
/**
* Constructor
* @param \Magento\Framework\View\Element\Template\Context $context
* @param array $data
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
array $data = []
) {
parent::__construct($context, $data);
}
/**
* Dump the variable
* @param $dumpMe mixed
*/
public function dump($dumpMe)
{
VarDumper::dump($dumpMe);
}
}
Or within phtml
<p>Hello index/dump.phtml</p>
<?php
Symfony\Component\VarDumper\VarDumper::dump('test');
$block->dump('test');
$block->dump(['arrayone', 'arraytwo']);
$object = ['key' => 'item'];
$block->dump(['array', 1, new Magento\Framework\DataObject($object)]);
?>
Demo output