php - How to check if the controller and action actually exist? -
in app record page views in database, in appcontroller:
$this->link->save(array( 'controller' => $this->request->params['controller'], 'action' => $this->request->params['action'], 'var1' => $this->request->params['pass'][0], 'var2' => $this->request->params['pass'][1] )); which works fine, of urls people (or bots) type in 404s. how can check see if these links real or not.
lots of requests previous websites on same domain, requests /images etc cake thinks controller.
i don't mind if check happens before entering database or after being retrieved database in view.
thanks!
haven't tried myself, can try calling router::parse()
you provide full url, , return value cake's route array can see values of controller, action etc.
Comments
Post a Comment