Admin Area In Yii


I’d like to create an administration area in my Yii framework but I don’t know how to start. Is there a tutorial on how to create one?


Admin panel = admin module (or separate app) + access control.

So if you’re familiar with creating basic apps, admin panel is not a problem.

See documentation for detail info about modules and auth.

Having a module as an admin panel is ok for small apps, for larger ones you’ll have to use sub-apps connected through a common app.

sorry guys, but I still have doubts. I need a more detailed tutorial.

Any particular questions?

I am lost. I need a step-by-step tutorial


A module is an mini webapp (has seperated mvc) inside your main application

so you could set seperated access.

seperated webapp is a new webapp (making a new web application) like the main application but it has

the functionallity that an admin should be.

Go through, this is a very comprehensive structure of Yii complex projects which shares common resources like models, libraries, scripts,etc. and simple to modifiy !

and structure is :


Backend entry point, expected to be your "admin side" of the application.


Binaries for you to use, including yiic, phing, phpunit and such. Note that while most of binaries are Composer-installed, yiic and selenium launchers are hand-crafted and not supposed to be removed/changed.


Configuration for various 3rd-party tools used in project harness, including Vagrant stuff and code style definition for CodeSniffer.


This folder is structured similarly to the traditional protected folder in autogenerated Yii application. You are expected to place the code global to all entry points in common. Backend-, frontend-, and console-specific stuff should go to backend, frontend and console dirs, respectively.


Console entry point, reachable by yiic console runner. Most important stuff here is your migrations, inside console/migrations subfolder.


Frontend entry point, expected to be public side of your application.


All project status reports from various code quality tools will be placed in here. Documentation from APIGen, too. You will not see this directory initially, it's auto-generated when needed.


Your test harness is here. See details in the there.


All third-party dependencies are installed by Composer in here, even Selenium. You will not see this directory initially, it's auto-generated when needed.