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

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -