• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.