Jump to content

Recommended Posts

Hey guys, I'm busy working on taking my companies current system and making it alot more modular, so that each module can be pulled out and work mostly on their own, with just a little custom tweaks. I have the general plan laid out, but I've run into a little snag. After managing to set up a Zend/PHP/MySQL/PHPMyAdmin enviroment on clean CentOS install, whenever I try to do a zf create project, it works, and I can visit the page saying that it's the main page, but when I create a new module (Base in this example) and go /base (After setting up the controller and view, and even the module bootstrap) it just gives me a 404. Same with /base/index and /base/index/index.

 

Any help I could receive would be legendary

Link to comment
https://forums.phpfreaks.com/topic/231245-zend-modules-arent-working/
Share on other sites

couple of things, I have my modules folder within the application folder, have you added :

 

resources.modules=''
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

into your application.ini. I had the same issue when i started trying to add modules and this sorted it

Ok, this can be a right pain to get to the bottom of. A few simple things that you can easily overlook.

1. Are you following a namespace convention. Ie your index controller in the base module looks like :

Class Base_IndexController extends .......

2. The names match identically, if foldername is base then class name should start with lowercase b.

 

I know it's really simple stuff, but the easiest problem to solve can sometimes be overlooked. I can't tell you how Many times I have come unstuck because I have accidently added a capital into one of my filenames / class names when I shouldn't off

 

Yes, I have.

 

My module name is framework, in the Module bootstrap I've set it's namespace to be Framework (capital). The controller is controllers/IndexController.php Framework_IndexController extends Zend_Controller_Action, the view is views/scripts/index/index.phtml

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.