[eluser]ericsodt[/eluser]
I come from a java background so working with PHP is a little different for me. I am trying to run some code in a try block and then if an exception is thrown throw it back to the view with the error message
Code:
try{
// this try WILL throw an error
switch ($_POST['recurring']){
case "day":
$dates = $this->dailyArray($_POST['startDate'],$_POST['endDate']);
break;
case "week":
$dates = $this->weeklyArray($_POST['startDate'],$_POST['endDate']);
break;
case "biweek":
$dates = $this->biweeklyArray($_POST['startDate'],$_POST['endDate']);
break;
case "month":
$dates = $this->monthlyArray($_POST['startDate'],$_POST['endDate']);
break;
}
} catch (Exception $e) {
echo "<br>".$e->getMessage()."<br>";
$this->load->view('addEvent_view');
exit();
}
The view never gets loaded... can anyone help me out??