zend-mvc icon indicating copy to clipboard operation
zend-mvc copied to clipboard

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

Open carnage opened this issue 10 years ago • 2 comments

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...

carnage avatar Jul 11 '15 20:07 carnage

Suggestions:

  • proposed fix is a bc break, no-go, even for 3.x (it is subtle)
  • use a separate listener for this functionality, and make it act with a lower priority (should be BC compliant then)

Ocramius avatar Jul 13 '15 09:07 Ocramius

This repository has been closed and moved to laminas/laminas-mvc; a new issue has been opened at https://github.com/laminas/laminas-mvc/issues/38.

michalbundyra avatar Jan 15 '20 19:01 michalbundyra