Skip to content

@robertbasic /Bootstrap.php
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Another way of loading ZF2 action helpers
<?php
class Bootstrap extends Application\Bootstrap {
/**
* Initializing action helpers
*/
public function _initActionHelpers()
{
// instead of this...
// Zend\Loader\PluginClassLoader::addStaticMap(array('loggedinuser' => 'Planet\Controller\Helper\LoggedInUser'));
// we can use this...
$this->bootstrap('FrontController');
$fc = $this->getResource('FrontController');
// but this isn't really lazy-loading, right?
$helper = new Planet\Controller\Helper\LoggedInUser();
$fc->getHelperBroker()->register('loggedinuser', $helper);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.