1

I'm working on a website that have virtual hosts, like xyz.com, asd.com and so on.

I use Hostname route like ":controller.com", so it routes me to the specific controller. I created a defaultController to a default behavior and I extended xyzController and asdController from that, so I only modify that I really want.

The problem is that, how can I create my DefaultController to be really default :) I mean, if I haven't created a controller for the specific route (forexample: xyzController for xyz.com), then I don't want to get a Fatal Error like

"Fatal error: Class 'aaaa\Controller\asdController' not found in /var/www/samba/aaaa/www/src/site/vendor/ZF2/library/Zend/ServiceManager/AbstractPluginManager.php on line 177"

Would be better if it route me to defaultController immediately.

I was thinking about the view_manager's templates like 'not_found_template'. That would be great if not_found_controller would exist :)

Is it possible to do somehow?

akond
  • 15,865
  • 4
  • 35
  • 55
Iburidu
  • 450
  • 2
  • 5
  • 15
  • Possible duplicate http://stackoverflow.com/questions/4286877/zend-route-catch-all?rq=1 – Crisp Jan 08 '13 at 17:07
  • Fatal error MUST NEVER occur in service manager. Here it means you either registered non-existant controller class as invokable or autoloading was not configured properly. Either way it is bug in your code/config and it should be fixed. – Xerkus Jan 08 '13 at 23:29

0 Answers0