diff --git a/Module.php b/Module.php index 019a842..03b3039 100644 --- a/Module.php +++ b/Module.php @@ -8,8 +8,12 @@ public function onBootstrap($e) $e->getApplication()->getEventManager()->getSharedManager()->attach('Zend\Mvc\Controller\AbstractController', 'dispatch', function($e) { $controller = $e->getTarget(); $controllerClass = get_class($controller); - $moduleNamespace = substr($controllerClass, 0, strpos($controllerClass, '\\')); $config = $e->getApplication()->getServiceManager()->get('config'); + if (isset($config['module_layouts'][$controllerClass])) { + $controller->layout($config['module_layouts'][$controllerClass]); + return; + } + $moduleNamespace = substr($controllerClass, 0, strpos($controllerClass, '\\')); if (isset($config['module_layouts'][$moduleNamespace])) { $controller->layout($config['module_layouts'][$moduleNamespace]); } diff --git a/composer.json b/composer.json index 157289b..9a30040 100644 --- a/composer.json +++ b/composer.json @@ -1,24 +1,22 @@ { - "name": "evandotpro/edp-module-layouts", - "description": "EdpModuleLayouts is very simple ZF2 module for making module-specific layouts insanely easy.", - "type": "library", - "keywords": [ - "zf2" - ], - "homepage": "https://github.com/EvanDotPro/EdpModuleLayouts", - "authors": [ - { - "name": "Evan Coury", - "email": "me@evancoury.com", - "homepage": "http://blog.evan.pro/" - } - ], - "require": { - "php": ">=5.3" + "name" : "ixtec/edp-module-layouts", + "description" : "EdpModuleLayouts is very simple ZF2 module for making module-specific layouts insanely easy.", + "require" : { + "php" : ">=5.3" }, - "autoload": { - "classmap": [ - "./Module.php" - ] - } -} + "authors" : [{ + "name" : "Evan Coury", + "email" : "me@evancoury.com", + "homepage" : "http://blog.evan.pro/" + }, { + "name" : "Oliver Konig", + "email" : "ixtec.io@gmail.com", + "homepage" : "http://ixtec.io/" + }], + "keywords" : [ "zf2" ], + "autoload" : { + "classmap" : [ "./Module.php" ] + }, + "type" : "library", + "homepage" : "https://github.com/ixtec/EdpModuleLayouts" +} \ No newline at end of file