[eluser]stevefink[/eluser]
Folks,
I'm trying to pass $dataArr to my view via the following method:
Code:
$dataArr['error'] = '';
if($current_carfax)
{
$dataArr['current_carfax'] = $current_carfax;
}
else
{
$dataArr['current_carfax'] = '';
}
//log_message('debug', "Data ARRAY: ".print_r($dataArr, TRUE));
// This loads the initial view if no $_POST or $_FILES array exists.
$this->load->view('console/car_fax_view',$dataArr);
I'm explicitly setting $dataArr['current_carfax'] to an empty string here. Is there a reason my view will complain that $current_carfax is an undefined variable? Shouldn't the above fix that? It fixes it for $error, that's for sure.
In the loop that checks if the variable should be declared before that code is this:
Code:
$is_enabled = $this->autodb->update_carfax($vehicle_id);
if($is_enabled)
{
foreach( glob("$carfax_loc/$vehicle_id" . "*.*") as $file)
{
$current_carfax = substr($file,1);
}
}
else
{
$current_carfax = '';
}
Thanks for any insight.