Best approach for backend-frontend development in YII

i am little bit confused after reading some article on Backend-Frontend development approach in YII.

Can any one suggest me which is the best and a standered approach for all type of applications like small scale,medium scale and large scale applications ?

I have gone through following articles and i am in dilemma :-

[list=1][]http://www.yiiframework.com/wiki/63/organize-directories-for-applications-with-front-end-and-back-end-using-webapplicationend-behavior[]http://www.yiiframework.com/wiki/33/organize-directories-for-applications-with-front-end-and-back-end[*]http://www.yiiframework.com/wiki/155/the-directory-structure-of-the-yii-project-site/#hh1[/list]and if you suggest anyone from above articles please provide the comparison with important differences.

There is no the best approach. Also there is a 4th option: admin module.

Which approach to use depends on:

  • are you developing an application alone or in a team;

  • how big is the application;

  • do you want to have fully separate backend/frontend or not (with different url types, login systems, etc.);

  • will you need to move backend to another server;

  • your personal taste of course :)

[list=1]

[*] I used it successfully in several small projects (frontend and backend are separated).

[*] I didn’t use it, but it should work well for small and medium projects (frontend and backend are separated).

[*] Nice approach for a team development and if you want to move backend to another server.

[*] (admin module) Probably the most popular approach for small projects (it can be also used for big projects of course, but I just can’t estimate it’s popularity in this case :lol:). Backend is a part of a frontend (means backend and frontend use the same url manager, user application component, etc.). Very easy to install and use. Inside the admin module you put controllers to manage data (create, update, delete, etc.) + correponding views, and protected/controllers are just to list/view data.

[/list]

Hope it helps ;)

I tend to use the 4th approach too, i’ve used it in small and large cases and in teams so its pretty flexible. I would say sub modules might be worth looking at if its a huge project (20 controllers+) but not needed as it just organises code a little better.

Thanks andy and Jaggi good advice will keep these in mind.

i need some for expertise view on same.

Hi all,

I a m using this directory structure for my apps :

Root :

|-Assets

|-CSS

|-IMAGES

|-PROTECTED

||-COMMANDS

||-COMPONENTS

||-CONFIG

||-CONTROLLERS

||-EXTENSIONS

||-MESSAGES

||-MODELS

||-MODULES

|||-ADMIN (directory)

||-RUNTIME

||-VIEWS

|-THEMES

||-FRONTEND

|||-CSS

|||-IMAGES

|||-VIEWS

||-BACKEND

|||-CSS

|||-IMAGES

|||-VIEWS

If you are interested, i will send you my source code.

Hope it usefull.

nabil

Hi Nabil,

Could you send me code?

Andy, 4th Option: admin module. I’m sorry to ask you silly question but I’m not clear on it. What do you mean to have admin module, are you referring to a specific Yii Admin Extension or we can create a Module from gii -> Module Generator?

Thanks