|
|||
|
Since I upgraded from 0.9 to 1.0 I am having uncaught exceptions. Here is my front controller:
Code:
$oFront = Zend_Controller_Front::getInstance();
$oFront->setParam('useDefaultControllerAlways', true);
Zend_Controller_Front::run("/path/to/controllers");
File "IndexController.php" was loaded but class "Default_IndexController" was not found in the file Why is it asking for a class named Default_IndexController? If I comment out the 'useDefaultControllerAlways' then I get: Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' You may ask, why I am using that paramater? It's for 404 handling if a non-existent controller is specified in the URL (I have some code in index/index that redirects) If I add an error controller (per this thread) to output the exception, I get: 'Zend_View_Exception' with message 'script 'settings/index.phtml' not found in path' Why is it looking for that? I have a view called "Default.php" there which IS outputting. So why is ZF now looking for another file? Last edited by djames : 06-01-2007 at 05:03 PM. Reason: Progress |
|
||||
This problem was addressed in #zftalk. Apparently Zend released 1.0 quietly with the ViewRenderer helper enabled by default. I really don't think this was a good idea, but nevertheless I've learned to deal with the problem. It looks like all your problems are because of the ViewRender and possibly not using the ErrorHandler plugins correctly. Another thing to consider is the modular directory structure which zend seems to recommend because of the way their code is setup now ![]() The best way is to re-read and understand the controller section of the manual because it has changed alot.
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog |
|
|||
|
Thanks for the reply.
Yes, I must read (and hopefully understand) how Zend_Controller works.My 404 handling goes like this: by using the useDefaultControllerAlways, a bad url goes to index/index. Currently I hold a list of the existing controllers in the session (via scandir). If the incoming controller is not in the list, then I forward to a notFound() action. I fixed the ViewRenderer problem by putting exit() after render(). I also had to create: class Default_IndexController extends IndexController with the above error handling in order for it to work. And yes, modular is great, but it will require quite a few changes in my app ![]() Last edited by djames : 06-01-2007 at 08:22 PM. |
|
||||
|
:s thats a very "hacky" way of doing it heh. You can disable ViewRenderer using ($front->setParam('noViewRenderer')) or go through the HelperBroker
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog |
|
|||
|
Quote:
![]() |
|
||||
|
Zend Framework API Documentation
An ide with code completion always helps though... Looking through the api docs are annoyingly time consuming sometimes.
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog |
![]() |
| Thread Tools | |
| Display Modes | |
|
|