You could retrieve it in your controller using the MvcEvent object and then assign it to the ViewModel so you can retrieve it in the view:
public function indexAction()
{
return new ViewModel(
array(
'controller' => $this->getEvent()->getRouteMatch()->getParam('controller'),
'action' => $this->getEvent()->getRouteMatch()->getParam('action')
)
);
}
The module name is a bit trickier, but you could for instance get it using the NAMESPACE or just parse it from the controller name.
If you want to use this in multiple views then it's probably better to create and register your own view-helper.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…