<?php namespace Admin; use Zend\ModuleManager\ModuleManager; class Module { public function init(ModuleManager $moduleManager) { $sharedEvents = $moduleManager->getEventManager()->getSharedManager(); $sharedEvents->attach(__NAMESPACE__, ‘dispatch‘, function($e) { $controller = $e->getTarget(); $controller->layout(‘layout/admin‘); }, 100); } }
原文地址:http://my.oschina.net/leadsir/blog/311957