Here is what I've tried:
public function init(Manager $moduleManager)
    {
        $events = StaticEventManager::getInstance();
        $events->attach('bootstrap', 'bootstrap', array($this,
'initializeView'), 100);
        $events->attach('bootstrap', 'bootstrap', array($this,
'wireJsonStrategy'));
    }

public function wireJsonStrategy($e)
    {
        $app          = $e->getParam('application');
        *$view         = $this->getView($app);*
        $locator      = $app->getLocator();
        $jsonStrategy = $locator->get(*'Zend\View\Helper\Json'*);
        *$viewListener = $this->getViewListener($jsonStrategy,
$e->getParam('config'));*
        $app->events()->attachAggregate($viewListener);
    }
}
Not sure what I've done there, but no errors so far.. :)

How can I test this in the browser?

for example: http://localhost/user/login/*format/json* ?

Thanks!


--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-contextSwitch-to-json-tp4418147p4420831.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to