Working with 2 applications - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: Working with 2 applications (/showthread.php?tid=63952) |
Working with 2 applications - lama - 12-27-2015 Hello, I'm trying to redevelop my ecommerce with CI3 but I was already blocked with my two applications folder I have this folders :
What I set : index.php (root) PHP Code: $application_folder = 'applications/frontend'; applications/frontend/index.php PHP Code: $application_folder = '../frontend'; applications/frontend/config/config.php PHP Code: $config['base_url'] = 'http://localhost/eshop/frontend/'; applications/backend/index.php PHP Code: $application_folder = '../backend'; applications/backend/config/config.php PHP Code: $config['base_url'] = 'http://localhost/eshop/backend/'; Using REQUEST_URI and no index_page blank, all .htaccess are set like this : PHP Code: RewriteEngine On I'm well redirected on the frontend default controller when I go to localhost/eshop but when I type localhost/eshop/backend I have the 404 default error page. Any idea ? Thanks RE: Working with 2 applications - wolfgang1983 - 12-28-2015 I would look into HMVC https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc You might be best to create a second application folder called backend
Code: $system_path = '../system';
PHP Code: $application_folder = 'frontend'; RE: Working with 2 applications - lama - 01-06-2016 I don't understand... Why this is so complicated to get two applications ? I followed the user guide : https://ellislab.com/codeigniter/user-guide/general/managing_apps.html but there isn't instructions about htaccess... RE: Working with 2 applications - wolfgang1983 - 01-06-2016 (01-06-2016, 01:40 PM)lama Wrote: I don't understand... Why this is so complicated to get two applications ? Use HMVC RE: Working with 2 applications - lama - 01-14-2016 I can't rewrite all my project in HMVC there is too much controllers, views and model. I only want to migrate my 2 applications folder of CI2 to CI3... RE: Working with 2 applications - waptik - 01-18-2016 Instead of giving yourself a hard time,why not just do it simple as this? One single app with multiple areas. application/controllers/backend -> all backend controllers go in here. application/views/backend -> all backend views go in here. application/controllers -> all frontend controllers go in here. application/views/frontend -> all frontend views gn in here. Then in your application/core/MY_Controller.php , create two classes extending to CI_Controller: frontend(disable debug and anything you don't want users to see), backend(enable debug). Then back to your controllers: in application/controllers/{file}.php -> class {file} extends frontend{} , application/controllers/backend/{file}.php -> class {file} extends backend{}. Now you get http://localhost/eshop and http://localhost/eshop/backend working. |