Development of Adminpanel

This will be helpful for those who are in dilemma in developing adminpanel, so it can be guideline.

My question:

I am trying to make adminpanel for my project. I am confuse about placing this folder (i.e. admin): shall I put this folder inside the protected/modules or just in the root directory where other folder such as images, themes, protected, css exists.

Is that the better way to keep the folder outside of protected?

And this admin has it’s own layout and design.

Thanks for suggestion.

Use gii for generate the module, just one click!

Thanks zaccaia for reply, but it’s not what I asked.

Hum…, it’s known to create modules and models,… using gii but my main question is :

  1. Is it safe to use adminpanel (let’s say module. as Admin is also a kind of module) out side of protected?

  2. The folder name ‘protected’ is just a name or any protection is implemented?

Not sure about Q1 but as for Q2…It is ‘protected’ by the .htaccess file. It contains “deny from all” in the default setup, this tells apache that no one from the web can directly look,browse,download,etc. via something like <hostName>/protected/views/index.php. Not sure about this in IIS.

So maybe an answer to Q1: You could either make a module (protected by the .htaccess mentioned above), OR create a whole new web app as a dirctory equal to assets,images,protected,etc. Then to log on just use <hostname>/adminpanel/.

I have a developement machine that has numerious directories under htdocs that I use for developement of a number of different web sites. I placed the Yii::framework in this structure, so when I deploy with Yii one level up from htdocs on the production server all links to the framework work. So in my setup:




/htdocs

  -/yii

    -/framework

  -/site1

    -/assets

    -/css

    ...

    -/protected

      ...

      -/modules

        -/admin

          ...

      ...

  -/site2

    -/admin

      -/assets

      ...

    -/assets

    ...

  -/site3

...

So you can place your adminPanel either place. Just a thought ;D

  1. you can name your module whatever you want. ultimately, you can use routes to make any url link to code in this module. So don’t worry about what you name that module one bit.