Welcome Guest, Not a member yet? Register   Sign In
MY_Controller in ci2
#4

[eluser]LuckyFella73[/eluser]
you can do something like that:

Code:
<?php
class MY_Controller extends CI_Controller
{
    function __construct()
    {
        parent::__construct();

        $this->your_variable = 'Test Value';

    }
}

And access it later on in your controllers:
Code:
$this->your_variable



EDIT:
Phil Sturgeon has more informations about setting up base controllers in his blog:
http://philsturgeon.co.uk/news/2010/02/C...ing-it-DRY


Messages In This Thread
MY_Controller in ci2 - by El Forum - 05-23-2011, 09:07 PM
MY_Controller in ci2 - by El Forum - 05-23-2011, 09:29 PM
MY_Controller in ci2 - by El Forum - 08-04-2011, 03:17 PM
MY_Controller in ci2 - by El Forum - 08-05-2011, 02:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB