Welcome Guest, Not a member yet? Register   Sign In
Way to define $data array for all functions inside a class
#2

[eluser]pistolPete[/eluser]
Use a class variable:

Code:
class Some_controller extends Controller {

    var $default_data = array('title' => 'some title', 'color' => 'red');

     function Some_controller()
    {
        parent::Controller();
        print_r($this->default_data());
    }
}

Or setup a custom config file: http://ellislab.com/codeigniter/user-gui...onfig.html


Messages In This Thread
Way to define $data array for all functions inside a class - by El Forum - 08-21-2009, 08:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB