php - Exception Catch and CallHook -
i'm using callhook execute classes , methods in mvc framework. no add error-handling php exception function. i'm wondering best place execute catch command. request can (of course) lead execution of multiple classes. throughout system exceptions made. (example mentioned below). function callhook() { global $urlarray; //define controllers if (strlen(strstr($urlarray[0],'popup_'))>0) { $controller = substr($urlarray[0], 6); } else { $controller = $urlarray[0]; } $querystring[] = $urlarray[1]; $urlaction = $urlarray[2]; if(!isset($controller) && empty($controller)){ $controller = 'home';} if(!isset($urlaction) || empty($urlaction)){$action = 'view';}else{$action = $urlaction;} $controllername = str_replace('-','', $controller); $controller = ucwords($controller); $model = rtrim($controller, 's'); $controller .= 'controller'; ...