Welcome Guest, Not a member yet? Register   Sign In
Separate Client Portal from main app
#6

(11-17-2015, 04:46 PM)rtorralba Wrote: Hi,

I think you can make two folders in controllers for backend and frontend and the same at views, and share the models. In addition to this at MY_Controller php file you can add Backend_Controller for extend all backend controllers from it and where you must to check authorization, and put all functions that you need in backend controllers. You can use MY_Controller for frontend controllers.

- core
  - MY_Controller.php
    - class MY_Controller
    - class Backend_Controller
- controllers\
  - backend\
  - frontend\
- models\
- views\
  - backend\
  - frontend\

Hello,

I think i'm heading towards this direction. I did a quick lookup and from what i understand i should go with something like the below

My_controller.php
PHP Code:
<?php

class MY_Controller extends CI_Controller
{
  function 
__construct()
  {
    
parent::__construct();
  }
}

class 
Admin_Controller extends MY_Controller
{
  function 
__construct()
  {
    
parent::__construct();
  }
}

class 
Public_Controller extends MY_Controller
{
  function 
__construct()
  {
    
parent::__construct();
  }


So basically extend all the admin controlelrs to Admin_controller and all the public ones to the Public_controller.

I suppose something like that would work ?
"The Most Important Thing In Life Is Showing Up"
"I Just Had A Bad Day"
"We'll Be Back"
"Further Beyond"
Reply


Messages In This Thread
Separate Client Portal from main app - by Sentro - 11-17-2015, 03:25 AM
RE: Separate Client Portal from main app - by Sentro - 11-18-2015, 09:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB