Working with 2 applications |
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
I would look into HMVC https://bitbucket.org/wiredesignz/codeig...sions-hmvc
You might be best to create a second application folder called backend
Code: $system_path = '../system';
PHP Code: $application_folder = 'frontend';
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
I don't understand... Why this is so complicated to get two applications ?
I followed the user guide : https://ellislab.com/codeigniter/user-gu..._apps.html but there isn't instructions about htaccess...
(01-06-2016, 01:40 PM)lama Wrote: I don't understand... Why this is so complicated to get two applications ? Use HMVC
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
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...
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.
Be Simple
|
Welcome Guest, Not a member yet? Register Sign In |