Created
March 10, 2015 12:55
-
-
Save Colmea/b04cd9f50b6ac6ab1821 to your computer and use it in GitHub Desktop.
Custom View Helper ZF2
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
use MyModule\View\Helper\MyViewHelper; | |
class Module | |
{ | |
[...] | |
public function getViewHelperConfig() | |
{ | |
return array( | |
'factories' => array( | |
'MyViewHelper' => function($sm) { | |
$router = $locator->get('Router'); | |
$request = $locator->get('Request') | |
$myViewHelper = new MyViewHelper($router, $request); | |
return $myViewHelper; | |
}, | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment