[Help/Suggestion] New project - Backend and Frontend Setup |
[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 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 One for Frontend and other for Backend ( admin ) In my modules directory i have: Quote:modules I have setup the routes like this: Code: $route['admin/([a-zA-Z0-9_-]+)/(:any)'] = '$1/admin/$2'; 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 ?
[eluser]Glazz[/eluser]
Well i came up with a "solution" not the best one but it is working so far... For now i can have both config.php and database.php elsewhere. My edits is: application/config/config.php Code: <?php defined('BASEPATH') OR exit('Access denied!'); application/config/database.php Code: <?php defined('BASEPATH') OR exit('Access denied!'); index.php Code: /* And i created a config folder inside my system folder that looks like this: Quote:system Inside this config folder i pasted both original config.php and database.php files, and i can have the same config file for multiple applications. |
Welcome Guest, Not a member yet? Register Sign In |