Note that there are some explanatory texts on larger screens.

plurals
  1. POStep-by-step coversion to module-based folder structure for zend project, bounty coming
    text
    copied!<p>I have a 250 point bounty on this but the system doesn't allow me to start it right away. </p> <p>I'm looking for a step-by-step explanation on how to go from the normal folder structure on the left where the <code>application</code> folder contains <code>models,views,controllers</code>, to the module-based folder structure on the right where <code>application</code> contains a <code>modules</code> folder which contains the individual modules with their own <code>models,views,controllers</code>. </p> <p>I say "conversion" because I don't think zend lets us create projects using the module architecture from the start, but if it did, that would be swell and would remove the need to make these folder structure changes manually. </p> <p><img src="https://i.stack.imgur.com/3D8TA.jpg" alt="http://img375.imageshack.us/img375/5582/foldersboth.jpg"></p> <p><strong>Here's my experience so far</strong> </p> <ul> <li><p>When I create a module <code>zf create module product</code>, the modules folder is generated and a folder <code>product</code> is generated inside it and the <code>views,controllers,models</code> for that module are also generated. </p></li> <li><p>But I also need to move the main <code>views,controllers,models</code> to a <code>modules/default</code> folder of their own. If I create that folder manually and move the main <code>views,models,controllers</code> there, I get a bug when trying to add new controllers to that <code>default</code> module. The bug is that it <strong>re-generates</strong> the main (now missing) <code>views,controllers,models</code> in <code>application</code> and inserts that new controller in <code>application/controllers/newcont</code> because it doesn't recognize that the default controllers folder has been moved manually to <code>application/modules/default/controllers/</code>. </p></li> <li><p>So my solution to that has been to <code>zf create module default</code> then copy the main <code>views,models,controllers</code> there. It ends up looking the same but somehow the <code>zf create module</code> method makes a difference. When I do it this way, new controllers get added correctly into <code>application/modules/default/controllers</code> and not <code>application/controllers</code></p></li> </ul> <p>Half the problem solved. But when I try to view the application, I don't see anything from <code>index/index</code> view. I don't get any errors either, but I see nothing. I suspect that it's because the application doesn't know that the <code>index/index</code> view has moved.</p> <ul> <li>This used to be located at <code>application/views/scripts/index/index.phtml</code> </li> <li>but is now located at <code>application/modules/default/views/scripts/index/index.phtml</code></li> </ul> <p>I'm guessing I need to make changes to application.ini or to bootstrap.php or some other location. So what exactly are the steps to get this thing done smoothly and get it working? I'm using the latest ZF 1.10.8. Please start from create a new zend project so there's no confusion on the exact steps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload