Welcome Guest, Not a member yet? Register   Sign In
[Help/Suggestion] New project - Backend and Frontend Setup
#1

[eluser]Glazz[/eluser]
Hey there, i'm starting another project using CI.. this time i want to have only one application but i want to have an admin area also.

In my other projects i have 2 application folders ( 2 different index.php files ) 1 system folder

Something like:
Quote:admin
| protected ( this haves all the CI application stuff )
| config
| controllers
| ....
| index.php
site
| protected ( this haves all the CI application stuff )
| config
| controllers
| ....
| index.php
system


And it works like i wanted, but the downside is, i have duplicated code, need to setup two applications ( database and config settings ), and it is a pain in the a** for my clients to understand if they need to change something...

----

Now i want to try to build this new project using only one application.

I have:
- CodeIgniter 2.1.0
- Modular extensions HMVC by wiredesignz

And the work i have done so far is:

I have two extended CI_Controllers
Quote: | MY_Controller extends CI_Controller
| MY_Admin extends MY_Controller

One for Frontend and other for Backend ( admin )

In my modules directory i have:
Quote:modules
| admin
| clients
| controllers
| admin.php ( this extends the backend controller )
| models
| views


I have setup the routes like this:
Code:
$route['admin/([a-zA-Z0-9_-]+)/(:any)']     = '$1/admin/$2';
$route['admin/([a-zA-Z0-9_-]+)']   = '$1/admin/index';


So this way i can access http://localhost/admin/$my_controller[/$my_method]


In my backend controller i'm going to check if the user haves permissions and that good stuff...


Do you guys think this is a good setup ?

And there is some way that i have all the admin modules in one folder ? And the frontend in another folder ?


Messages In This Thread
[Help/Suggestion] New project - Backend and Frontend Setup - by El Forum - 03-04-2012, 09:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB