Hi there
I have a function inside of a view function inside of a model class in the model.php file that looks like this
function sqlToUnix($date){
$YMDThenHMS = explode(" ", $date);
$YMD = explode("-", $YMDThenHMS[0]);
$HMS = explode(":", $YMDThenHMS[1]);
$UnixTime = mktime($HMS[0], $HMS[1], $HMS[2], $YMD[1], $YMD[2], $YMD[0]);
return $UnixTime;
}
The problem is, when it returns $UnixTime, The return value is usable inside the model controller specific view function but it won't render my view (stops script propogation)
Is there a place where I can build functions like this up for use ANYWHERE in ANY Controller?
Such as the function time() built into PHP itself, I want to be able to use sqlToUnix anywhere