src/Controller/Component/MobileComponent.php
public function detect() {
		// Deprecated - the vendor libs are far more accurate and up to date
		if (!$this->_config['engine']) {
			if (isset($this->Controller->RequestHandler)) {
				return $this->Controller->getRequest()->is('mobile') || $this->Controller->RequestHandler->accepts('wap');
			}
			return $this->Controller->getRequest()->is('mobile');
		}
		if (is_callable($this->_config['engine'])) {
			return call_user_func($this->_config['engine']);
		}
		throw new RuntimeException(sprintf('Engine %s not available', $this->_config['engine']));
	}
public function detect() {
		// Deprecated - the vendor libs are far more accurate and up to date
		if (!$this->_config['engine']) {
			if (isset($this->Controller->RequestHandler)) {
				return $this->Controller->getRequest()->is('mobile') || $this->Controller->RequestHandler->accepts('wap');
			}
			return $this->Controller->getRequest()->is('mobile');
		}
		if (is_callable($this->_config['engine'])) {
			return call_user_func($this->_config['engine']);
		}
		throw new RuntimeException(sprintf('Engine %s not available', $this->_config['engine']));
	}
public function detect ( ) { // Deprecated - the vendor libs are far more accurate and up to date if ( ! $ this -> _config [ 'engine' ] ) { if ( isset ( $ this -> Controller -> RequestHandler ) ) { return $ this -> Controller -> getRequest ( ) -> is ( 'mobile' ) || $ this -> Controller -> RequestHandler -> accepts ( 'wap' ) ; } return $ this -> Controller -> getRequest ( ) -> is ( 'mobile' ) ; } if ( is_callable ( $ this -> _config [ 'engine' ] ) ) { return call_user_func ( $ this -> _config [ 'engine' ] ) ; } throw new RuntimeException ( sprintf ( 'Engine %s not available' , $ this -> _config [ 'engine' ] ) ) ; }
Detects if the current request is from a mobile device.

Note that the cake internal way might soon be deprecated:
https://github.com/cakephp/cakephp/issues/2546

@return bool Success
@throws \RuntimeException
Detects if the current request is from a mobile device .