laminas / laminas-mvc

Laminas's event-driven MVC layer, including MVC Applications, Controllers, and Plugins
https://docs.laminas.dev/laminas-mvc/
BSD 3-Clause "New" or "Revised" License
143 stars 52 forks source link

Can't set a controller map template replacement to an empty string #38

Open michalbundyra opened 4 years ago

michalbundyra commented 4 years ago

The Inject template listener allows specifying a controller_map to map namespaces or specific controllers to directories. It is not currently possible to specify a mapping for a namespace to '' eg:

'controller_map' => [
    'my/long/namespace' => '',
]

This is due to a == comparison with false in the listener on line 142: https://github.com/zendframework/zend-mvc/blob/f46acd021a0d571bc5df400bdd55243adc53580e/src/View/Http/InjectTemplateListener.php#L142 which should probably be ===

Fixing this may break BC...


Originally posted by @carnage at https://github.com/zendframework/zend-mvc/issues/12

michalbundyra commented 4 years ago

Suggestions:


Originally posted by @Ocramius at https://github.com/zendframework/zend-mvc/issues/12#issuecomment-120876057