Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-05-2008, 09:22 PM
Junior Member
 
Join Date: Mar 2008
Posts: 11
Default routing for modules not working

The ZF documentation says that in order to implement a modular design (with standard directory structure as explained in Zend Framework: Documentation), I should call
Code:
$front->addModuleDirectory('../application/modules');
It goes on to say "a module will only be matched if a key of the same name exists in the controller directory array passed to the front controller and dispatcher". So I added the line
Code:
$front->addControllerDirectory ('../application/modules/module1/controllers', 'module1');
But when I try to load www.mysite.com/module1/cont1, I get an error. Even when I try to load www.mysite.com/module1/cont1/index, I still get an error. The controller and index action do exist. It finds the controllers for my default module just fine. What am I missing?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-05-2008, 10:06 PM
Junior Member
 
Join Date: Mar 2008
Posts: 11
Default

I ran some tests, changed the name of an xml config file I open in my controller's init function and got an error saying it could not find the incorrectly named file. That proved that it is indeed finding the correct controller file. But I still get my default error page, so something is not set up right.

I also commented out all of the code in my indexAction except for render ('testapp'); No luck. I also tried changing the name of testapp.phtml to index.phtml and moving the view scripts down one level to the scripts directory. Still didn't work.

Here is my directory structure.

modules
--default [same as below]
--module1
----controllers
------TestappController.php
----views
------scripts
--------testapp
----------testapp.phtml
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:57 PM.