Welcome Guest, Not a member yet? Register   Sign In
building an efficient admin control panel
#8

[eluser]Michael Wales[/eluser]
MY_Controller.php
Code:
class Admin_Controller extends Controller {
  function admin_controller() {
    parent::Controller();
    if (!$logged_in) redirect('');
    $user = getUser($uniqueID);
  }
}

class Public_Controller extends Controller {
  function public_controller() {
    parent::Controller();
  }
}

admin.php
Code:
class Admin extends Admin_Controller {
  function __construct() {
    parent::Admin_Controller();
  }

  // This is just here for "need-be" circumstances - maybe logout?
  function logout() {
    $this->logThatBastardOut();
    redirect('');
  }
}

admin_pages.php
Code:
class Admin_pages extends Admin_controller {
  // This was accessed via domain.com/admin/pages
  // routes.php made a pimp-ass assist and let us route that URI to this controller

  function __construct() {
    $parent::Admin_controller();
    $this->load->model('pages_m');
  }

  function create() {
    // Let's make a new page
  }
}

Note: If you copy-paste that code and complain it doesn't work I swear...


Messages In This Thread
building an efficient admin control panel - by El Forum - 12-05-2007, 12:22 PM
building an efficient admin control panel - by El Forum - 12-05-2007, 12:49 PM
building an efficient admin control panel - by El Forum - 12-05-2007, 01:01 PM
building an efficient admin control panel - by El Forum - 12-05-2007, 01:18 PM
building an efficient admin control panel - by El Forum - 12-06-2007, 02:30 AM
building an efficient admin control panel - by El Forum - 12-06-2007, 03:14 AM
building an efficient admin control panel - by El Forum - 12-06-2007, 07:23 AM
building an efficient admin control panel - by El Forum - 12-06-2007, 09:22 AM
building an efficient admin control panel - by El Forum - 12-06-2007, 09:44 AM
building an efficient admin control panel - by El Forum - 12-06-2007, 10:37 AM
building an efficient admin control panel - by El Forum - 12-06-2007, 12:51 PM
building an efficient admin control panel - by El Forum - 12-06-2007, 07:41 PM
building an efficient admin control panel - by El Forum - 12-07-2007, 02:03 AM
building an efficient admin control panel - by El Forum - 12-07-2007, 08:12 AM
building an efficient admin control panel - by El Forum - 12-07-2007, 08:18 AM
building an efficient admin control panel - by El Forum - 12-07-2007, 08:51 AM
building an efficient admin control panel - by El Forum - 12-07-2007, 09:35 AM
building an efficient admin control panel - by El Forum - 12-07-2007, 09:37 AM
building an efficient admin control panel - by El Forum - 12-07-2007, 09:41 AM
building an efficient admin control panel - by El Forum - 12-07-2007, 08:54 PM
building an efficient admin control panel - by El Forum - 11-23-2010, 06:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB