Yii Framework Forum: folder structure - Yii Framework Forum

Jump to content

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

folder structure Rate Topic: -----

#1 User is offline   renathy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 82
  • Joined: 05-July 11

Posted 21 May 2012 - 05:14 AM

Hi!
I am new to Yii and I want to create the correspondint file structure.
I need frontent to be accessable via www.mysite.com
and backand to be accessable via www.mysite.com/admin

I will use simple hardcoded admin username/password for administation for now.

What would be the best folder structure?
I have found the following http://www.yiiframew...i-project-site/
but I do not understand if it fits my needs.

As I have read in some forum topics this makes two different vhost links (for backend and frontend).
I actually do not need it. I need to have only one virtual host link that points to www.myside.com.
0

#2 User is offline   sensorario 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,986
  • Joined: 07-September 10
  • Location:Cesena (Italy)

Posted 21 May 2012 - 05:17 AM

I suggest you to create admin module. So you link will be index.php?r=admin/controller/action instead of index.php?r=controller/action.
0

#3 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 506
  • Joined: 08-August 09

Posted 21 May 2012 - 05:43 AM

Admin module
or
add sub-folder "admin" in /controllers and /views and put you controllers and view files into them.
If you need something simple I'd go with the second approach. For a more advanced usage I'd go with an admin module.

I'd use the approach from the link you provided for a large/huge project only.
0

#4 User is offline   renathy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 82
  • Joined: 05-July 11

Posted 21 May 2012 - 06:12 AM

Thank you.
I have quite simple project, so I like an approach with admin subfolders.

However, I have a question:
when do you choose to have admin subfolder and when do you use admin module?
0

#5 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 506
  • Joined: 08-August 09

Posted 21 May 2012 - 08:55 AM

Module usage description - I couldn't describe better :)

In other words: if you need not only back-end CRUDs with views, but used in back-end only models and/or components and/or external libraries, then, of course, you'd better to use a separate admin module.

IMO, there's not that big difference for a simple back-end between these approaches, and the choice often depends on whole application design and architect developer taste.
0

#6 User is offline   Bynton 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 09-July 12

Posted 17 July 2012 - 10:45 PM

If you want to go for advance you should go with module or add sub-folder "admin" in /controllers and /views and put you controllers and view files into them..
0

#7 User is offline   MobiDev Corporation 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 10-June 12

Posted 28 July 2012 - 06:59 AM

I believe it's better to use module, it's more yii-way.
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