neilime / zf2-assets-bundle

AssetsBundle is a module for Zend Framework 2 allowing asset managment (bundling & caching)
https://neilime.github.io/zf2-assets-bundle/
MIT License
33 stars 20 forks source link

detect module if the controller is defined with alias #14

Closed Repkit closed 10 years ago

Repkit commented 10 years ago

If the controller is defined in this way: controllers' => array ( 'invokables' => array ( 'test' => 'Test\Controller\TestController', )); then $MvcEvent->getRouteMatch()->getParam('controller') will return 'test' instead of 'Test\Controller\TestController'.

In this case module name can't be detected using explode by '\' cause will end in an error moduleName = controllerName (cause controller does not contain any '\')

NB: maybe is not the cleaner solution but can be a start point and it works :)

neilime commented 10 years ago

Please tell me if what I've done is correct for you (https://github.com/neilime/zf2-assets-bundle/commit/6db54bf34a575b62a88f08e9cd54fe702e0c22c8)

Repkit commented 10 years ago

it works ok:) thank you