I am embarking on creating a Yii project that basically has a shared data model (let's say CerealStuff
) with a front-end web site (call it site
), admin site admin
, and web service ws
. I am new to the whole MVC thing and I wanted to know how I should design this project to stay consistent with Yii/MVC best practices. So far I have identified two basic options:
- Create models
CerealStuff
at root, create three modulessite
,admin
, andws
each with their own controllers; - Create models
CerealStuff
at root, create two modulesadmin
andpublic
withpublic
containing controllers that handle Site and have @soap declarations to handle ws stuff.
I know that option 2 reduces the total amount of reproduced coding but it does not feel as clean quite honestly. Also I feel like maybe a modern web app should be such that even the "site" (view) uses the web service to access the database.
Tell me what to think!