Yii Framework Forum: Modules With Common Models, Different Controllers In A Backend/common/frontend Setup - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Modules With Common Models, Different Controllers In A Backend/common/frontend Setup Rate Topic: -----

#1 User is offline   Lence 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 02-February 13

Posted 02 February 2013 - 10:28 AM

Hi, I was wondering, how exactly do you guys structure the modules of your projects that are set up in a backend/frontend/common fashion?

For example, the project I'm working on handles new "course" purchases at the frontend. Using the backend application, the courses and purchases can be managed. Both sides have common models, but their controllers are entirely different (although named the same). Here are some approaches I've considered:

1) Creating a course module in the common folder (and different views in frontend and backend of course). Problem is, "admin" and "user" functionality is all mixed up in the controllers now. So that's not good.

2) Only models in common. No modules, but instead creating subdirectory "course" in both frontend.controllers and backend.controllers. I imagine I'd have to set up the config too to make sure requests are routed to those subdirectories. But modules make so much more sense though... :P

3) Models in the common folder, while creating a course module in the frontend and another course module in the backend. This makes the most sense to me now, but I was wondering if you know of alternative/better solutions?

Thanks.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users