Use module into Zend_Tool 1.8.1

For programming and general questions on Zend Framework
Post Reply
a-alonzi
Posts: 1
Joined: Tue May 26, 2009 10:31 am

Use module into Zend_Tool 1.8.1

Post by a-alonzi » Tue May 26, 2009 10:32 am

Hi to all,
I try to use Zend_Tool 1.8.1 to create a controller into new module, but I have some problem.
I did:
$ zf create project prova
$ cd prova
$ zf create module admin
Now, I see new directory "application/modules/admin/" and sub-directory "controllers models views". I try to create a new controller into admin module with:
$ zf create controller index index-action-included=1 admin
but ZF say me:
---------------
An Error Has Occurred
This project already has a controller named index
---------------
Can I have a controller name index into new module admin? Can I have the same controller name for different modules?

Next, I try to create a new controller into module admin with:
$ zf create controller gestione index-action-included=1 admin
and see:
--------------------------------
Creating a controller at /Applications/MAMP/mhd/zf/prova/application/modules/admin/controllers/GestioneController.php
Creating an index action method in controller gestione
Creating a view script for the index action method at /Applications/MAMP/mhd/zf/prova/application/views/scripts/gestione/index.phtml
Creating a controller test file at /Applications/MAMP/mhd/zf/prova/tests/application/controllers/GestioneControllerTest.php
Updating project profile '/Applications/MAMP/mhd/zf/prova/.zfproject.xml'
--------------------------------

Why I don't see the view "gestione" into module "admin" but into default module?

I think there is a problem into "public static function createResource" on row 46 of "ZendFramework-1.8.1/library/Zend/Tool/Project/Provider/View.php" file, because the $moduleName is null...

Thank you

schnapsten
Posts: 4
Joined: Thu Oct 27, 2011 10:38 am

Re: Use module into Zend_Tool 1.8.1

Post by schnapsten » Mon Nov 14, 2011 1:00 pm

Does Zend_Tool have the ability to generate a modular directory structure (where each module has its own models, views, and controllers)?

example:

/application/modules/default/controllers
/application/modules/default/models
/application/modules/default/views

/application/modules/admin/controllers
/application/modules/admin/models
/application/modules/admin/views

jschoenwolf
Posts: 239
Joined: Tue Aug 23, 2011 10:56 am

Re: Use module into Zend_Tool 1.8.1

Post by jschoenwolf » Thu Nov 17, 2011 1:16 pm

change to:
$ zf create controller Index index-action-included=1 -m admin
That should create an IndexController in module admin, I don't think you need to include the index-action-include switch unless you want to omit the indexAction(), the default is to make the indexAction().

jschoenwolf
Posts: 239
Joined: Tue Aug 23, 2011 10:56 am

Re: Use module into Zend_Tool 1.8.1

Post by jschoenwolf » Thu Nov 17, 2011 1:19 pm

schnapsten wrote:Does Zend_Tool have the ability to generate a modular directory structure (where each module has its own models, views, and controllers)?

example:

/application/modules/default/controllers
/application/modules/default/models
/application/modules/default/views

/application/modules/admin/controllers
/application/modules/admin/models
/application/modules/admin/views
the short answer is yes. It takes a little work with the application.ini to get everything to work right, but zend tool will make modules.

Post Reply