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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-17-2008, 04:41 PM
Junior Member
 
Join Date: Mar 2008
Posts: 3
Default Problem loading class in when accessing a module (since ZF 1.5.0)

After migrating to from ZF 1.0.4 to ZF 1.5.0, the controllers in my modules, which extend the controllers in the default module, are unable to load.

My layout:
app\default\controllers\IndexController.php: classname IndexController extends BaseController)
app\module1\controllers\IndexController (classname Module1_IndexController extends IndexController)

This results in:"Class 'IndexController' not found in DIR\module1\controllers\IndexController.php"

In my bootstrap I have properly added the controller directory to the frontend controller using. Did something concerning the naming conventions for modules change? It resembles the problem discussed in this thread. Switching back to ZF 1.0.4 solved this issue. Any tips?

Last edited by holtkamp : 03-17-2008 at 04:45 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-21-2008, 03:25 PM
Junior Member
 
Join Date: Oct 2007
Posts: 26
Smile

Hi,

I am not sure if you have resolved your issue. But what I have done was the following...

My dir structure looks like


/application/modules/default
/application/modules/mod1

I add this line to my bootstrap. In my case, I created an application class to handle just about everything.

$frontController->addModuleDirectory($this->module_path);

That line will set the root module directory. Thats pretty much all you have to get the controllers and such working. I am having an issue getting the models to work though. I understand it may have something to do with the addModuleDirectory method and it not adding the model directories. I am still trying to figure that one out.

Well, I hope that helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-22-2008, 10:37 AM
Junior Member
 
Join Date: Mar 2008
Posts: 3
Default

Quote:
Originally Posted by Howler9443 View Post
Hi,
I add this line to my bootstrap. In my case, I created an application class to handle just about everything.

$frontController->addModuleDirectory($this->module_path);
Thanks for your reply, I will have a look on it on tuesday. However, I configured the module dirs using:

Code:
->setControllerDirectory(array(
		      'default' 	=> './private/default/php/controllers',
		      'mod1'	 	=> './private/mod1/php/controllers',
		      'mod2'	=> './private/mod2/php/controllers'))
Myabe this is depreceated or so. Well, thanks anyway, Ill post my findings.

Cheers!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-22-2008, 08:31 PM
Junior Member
 
Join Date: Mar 2008
Posts: 3
Default

Quote:
Originally Posted by holtkamp View Post
Ill post my findings.

I did some trial and error and it seems my bootstrap is configured properly.

Suppose I have a module called 'mobile' with an IndexController which extend the IndexController of the default module. This looks like:

Code:
class Mobile_IndexController extends IndexController
Well, this results in
Code:
Fatal error: Class 'IndexController' not found in D:\Development\workspace\application\private\mobile\php\controllers\IndexController.php on line 9
so it routes to the proper file (in the module) but seems to be unable to find the class it extends from (IndexController from my default module).

But when I extend another controller from the default module, let's say my LogController, which ONLY exists in my default module, then everything works fine:

Code:
class Mobile_IndexController extends LogController

The relevant part of my bootstrap is now:

Code:
$front = Zend_Controller_Front::getInstance();
$front->->setModuleControllerDirectoryName('php/controllers')
		->addModuleDirectory('./private/')
		->setParam('noViewRenderer', true)   
		->throwExceptions(true);
try {
	$front->dispatch();
} catch (Exception $e) {
      // log or display exceptions
}
Somebody got the same issues?
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 08:46 PM.