Skip to content

Instantly share code, notes, and snippets.

@cgmartin
Last active December 10, 2015 20:28
Show Gist options
  • Save cgmartin/4488044 to your computer and use it in GitHub Desktop.
Save cgmartin/4488044 to your computer and use it in GitHub Desktop.
<?php
$this->navigation()->getPluginManager()->setAllowOverride(true)->setInvokableClass('menu', '\My\Helper');
// In Module.php
public function getViewHelperConfig()
{
return array(
// Change the Navigation View Helper plugins for ALL modules
'initializers' => array(
'changeNavigationHelpers' => function($helper) {
if ($helper instanceof \Zend\View\Helper\Navigation) {
$helper->getPluginManager()->setAllowOverride(true)->setInvokableClass('menu', '\My\Helper')
}
},
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment