Welcome Guest, Not a member yet? Register   Sign In
News and statistics in the left column
#4

[eluser]got 2 doodle[/eluser]
I think what you are looking for is to extend the controller class.

If you look in /system/libraries/Controller.php this is the main controller class.

If you extend the controller in /system/application/libraries/MY_controller.php

Then if you build (extend) all of your controllers based on MY_controller.php then any changes made to MY_controller.php will affect all of your controllers.

Take a look at BackendPro (search the forum) it does this extensively.
Code:
class Site_Controller extends Controller
    {
        var $_container;
        function Site_Controller()
        {
            // Call parent constructor
            parent::Controller();
        
            // Display page debug messages if needed
            /*if ( is_superadmin() AND $this->preference->item('page_debug'))
            {
                $this->output->enable_profiler(TRUE);
            }*/
            
            // Set site meta tags
            //$this->page->set_metatag('name','content',TRUE/FALSE);
            $this->page->set_metatag('content-type','text/html; charset=utf-8',TRUE);
            $this->page->set_metatag('robots','all');
            $this->page->set_metatag('pragma','cache',TRUE);
            
            log_message('debug','Site_Controller Class Initialized');
        }
    }

This does some default stuff..
Quote: class Public_Controller extends Site_Controller
{
function Public_Controller()
{
// Call parent constructor
parent::Site_Controller();........

Quote: class Home extends Public_Controller
{
function Home()
{
parent:Tongueublic_Controller();
}

function index()

And so it goes...
...like an onion.

hope this helps
doodle


Messages In This Thread
News and statistics in the left column - by El Forum - 12-06-2008, 10:58 AM
News and statistics in the left column - by El Forum - 12-06-2008, 11:57 AM
News and statistics in the left column - by El Forum - 12-06-2008, 12:03 PM
News and statistics in the left column - by El Forum - 12-06-2008, 02:09 PM
News and statistics in the left column - by El Forum - 12-08-2008, 08:53 AM
News and statistics in the left column - by El Forum - 12-08-2008, 09:09 AM
News and statistics in the left column - by El Forum - 12-08-2008, 09:56 AM
News and statistics in the left column - by El Forum - 12-08-2008, 12:45 PM
News and statistics in the left column - by El Forum - 12-08-2008, 12:47 PM
News and statistics in the left column - by El Forum - 12-08-2008, 01:11 PM
News and statistics in the left column - by El Forum - 12-08-2008, 01:25 PM
News and statistics in the left column - by El Forum - 12-08-2008, 01:31 PM
News and statistics in the left column - by El Forum - 12-08-2008, 01:38 PM
News and statistics in the left column - by El Forum - 12-09-2008, 05:26 AM
News and statistics in the left column - by El Forum - 12-09-2008, 10:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB