Last active
December 16, 2015 18:00
-
-
Save tomshaw/5474845 to your computer and use it in GitHub Desktop.
ZF2 debug dump controller plugin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Controller\Plugin; | |
use Zend\Mvc\Controller\Plugin\AbstractPlugin; | |
use Zend\Debug\Debug; | |
class Dump extends AbstractPlugin | |
{ | |
public function __invoke($var, $label = null, $echo = true) | |
{ | |
return Debug::dump($var, $label = null, $echo = true); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getControllerPluginConfig() | |
{ | |
return array( | |
'invokables' => array( | |
'dump' => 'Application\Controller\Plugin\Dump' | |
) | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage | |
$this->dump(get_class_methods($this)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment