CakePHP - Checking from which controller and action request came -


hi there way check request came in cakephp ? need check if user has registered or not. cheers

maybe might help. here static class returns either controller name or action name:

    class customrouter extends object     {          public static function controller_name() {                 $url_string = router::url();                 return ( !empty( $url_string ) && is_string( $url_string ) ) ?                     explode( '/', $url_string )['1'] :                     null ;          }           public static function action_name() {                $url_string = router::url();                return ( !empty( $url_string ) && is_string( $url_string ) ) ?                     explode( '/', $url_string )['2'] :                     'index' ;          }      } 

Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -