user570499
user570499

Reputation: 1

How do you distinguish between modules and controllers in Zend Framework

For example, we need to add a news component to a website, and it will have add/edit/delete/listing functions. Which option will you go for?

Option1:

modules
- admin
   controllers
     NewsController (addAction, editAction, deleteAction, listAction, etc)
- default
   controllers
     NewsController (listAction)

Option2:

modules
- admin
- default
- news
   controllers
     IndexController (addAction, editAction, deleteAction, listAction, etc)
   models
   views

Any better ideas?

Upvotes: 0

Views: 87

Answers (1)

Cobby
Cobby

Reputation: 5454

I use something similar to option 1.

Option 2 is mixing frontend and backend logic so it gets messy.

If you're working on an very small app, maybe got with option 2 but separate add, edit, delete into an AdminController within the news module.

Upvotes: 1

Related Questions