Welcome Guest, Not a member yet? Register   Sign In
Frontend and Backend (Base controllers)
#12

[eluser]cPage[/eluser]
Quote:I don't know if you're confusing terminology, but you never want libraries to extend a controller class.

What do you think you do when you do this :


Code:
class Common
{
private $ci;

public function __construct()
{
   $this->ci =& get_instance();
} ....

/* Location: ./application/libraries/common.php */


Anyway this code looks great for me :

Code:
<?php
class Admin extends Admin_Controller
{
function __construct()
{
  parent::__construct();
}

public function index()
{
  $this->data['header']['title'] = 'Administration';
  $this->data['nav']['active'] = 'administration';
  $this->data['content'] => $this->admin_model->dashboard($this->data['group']);
  
  $this->template->set('header', $this->config->item('theme_url').'header', $this->data['header']);
  $this->template->set('nav', $this->config->item('theme_url').'admin/nav', $this->data['nav']);
  $this->template->set('content', $this->config->item('theme_url').'admin/'.$this->data['group'], $this->data['content']);
  $this->template->load($this->config->item('theme_url').'m_template');
}
}
?>


Messages In This Thread
Frontend and Backend (Base controllers) - by El Forum - 01-20-2013, 08:47 PM
Frontend and Backend (Base controllers) - by El Forum - 01-20-2013, 08:50 PM
Frontend and Backend (Base controllers) - by El Forum - 01-20-2013, 10:55 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 07:37 AM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 07:57 AM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 08:10 AM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 04:58 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 06:00 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 08:36 PM
Frontend and Backend (Base controllers) - by El Forum - 01-21-2013, 10:49 PM
Frontend and Backend (Base controllers) - by El Forum - 01-22-2013, 12:21 AM
Frontend and Backend (Base controllers) - by El Forum - 01-22-2013, 12:45 AM
Frontend and Backend (Base controllers) - by El Forum - 01-22-2013, 12:58 AM
Frontend and Backend (Base controllers) - by El Forum - 01-23-2013, 07:27 PM
Frontend and Backend (Base controllers) - by El Forum - 01-23-2013, 09:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB