[eluser]gscharlemann[/eluser]
I'm reading some data from a config file into an array. Is there a way to do this (I think php is barfing on my default parameter assignment)
Code:
class Tracker_model extends Model
{
public $tables = array();
public $schedule_sort_by = array();
public function __construct()
{
parent::Model();
$this->load->config('tracker');
$this->tables = $this->config->item('tables');
$this->schedule_sort_by = $this->config->item('schedule_sort_by');
}
public function get_user_schedule($user_id, $sort_by = $schedule_sort_by['scheduled_date'])
{
...
}
}
$schedule_sort_by['scheduled_date] is the "default" column heading I would like to sort by if it's not specified. I could hard code it, but the column name might change based on setup, that's why it's defined in the config file.
thanks!