CakePHP Cookbook 2.x
a pattern value detector. $this->request->addDetector( 'iphone', array('env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i') ); // Add an option detector. $this->request->addDetector('internalIp' Check to see whether the request is via SSL is('flash') Check to see whether the request has a User-Agent of Flash is('mobile') Check to see whether the request came from a common list of mobile agents. headers that were used for the request. For example: $this->request->header('User-Agent'); would return the user agent used for the request. CakeRequest::input($callback[, $options]) Retrieve the input0 码力 | 1096 页 | 958.62 KB | 1 年前3
 CakePHP Cookbook 2.x
// Add a pattern value detector. $this->request->addDetector( 'iphone', array('env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i') ); // Add an option detector. $this->request->addDetector('internalIp' to see whether the request is via SSL • is('flash') Check to see whether the request has a User-Agent of Flash • is('mobile') Check to see whether the request came from a common list of mobile agents headers that were used for the request. For example: $this->request->header('User-Agent'); would return the user agent used for the request. CakeRequest::input($callback[, $options]) Retrieve the input0 码力 | 820 页 | 2.52 MB | 1 年前3
 CakePHP Cookbook 3.x
Add a pattern value detector. $this->request->addDetector( 'iphone', ['env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i'] ); // Add an option detector $this->request->addDetector('internalIp' Check to see whether the request is via SSL. is('flash') Check to see whether the request has a User-Agent of Flash. is('requested') Check to see whether the request has a query param ‘requested’ with value request. For example: // Get the header as a string $userAgent = $this->request->getHeaderLine('User-Agent'); // Get an array of all values. $acceptHeader = $this->request->getHeader('Accept'); // Check0 码力 | 1244 页 | 1.05 MB | 1 年前3
 CakePHP Cookbook 3.x
); // Add a pattern value detector. $this->request->addDetector( 'iphone', ['env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i'] ); // Add an option detector $this->request->addDetector('internalIp' to see whether the request is via SSL. • is('flash') Check to see whether the request has a User-Agent of Flash. • is('requested') Check to see whether the request has a query param ‘requested’ with value request. For example: // Get the header as a string $userAgent = $this->request->getHeaderLine('User-Agent'); // Get an array of all values. $acceptHeader = $this->request->getHeader('Accept'); // Check0 码力 | 967 页 | 2.80 MB | 1 年前3
 CakePHP Cookbook 4.x
documentation and named parameters. Http Http\Client now uses ini_get('user_agent') with ‘CakePHP’ as a fallback for its user-agent. ORM Aligned Entity::isEmpty() and Entity::hasValue() to treat ‘0’ as a Add a pattern value detector. $this->request->addDetector( 'iphone', ['env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i'] ); // Add an option detector $this->request->addDetector('internalIp' Check to see whether the request is via SSL. is('flash') Check to see whether the request has a User-Agent of Flash. is('json') Check to see whether the request has ‘json’ extension and accept ‘application/json’0 码力 | 1249 页 | 1.04 MB | 1 年前3
 CakePHP Cookbook 4.x
documentation and named parameters. Http • Http\Client now uses ini_get('user_agent') with ‘CakePHP’ as a fallback for its user-agent. ORM • Aligned Entity::isEmpty() and Entity::hasValue() to treat ‘0’ as ); // Add a pattern value detector. $this->request->addDetector( 'iphone', ['env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i'] ); // Add an option detector $this->request->addDetector('internalIp' to see whether the request is via SSL. • is('flash') Check to see whether the request has a User-Agent of Flash. • is('json') Check to see whether the request has ‘json’ extension and accept ‘application/json’0 码力 | 967 页 | 2.88 MB | 1 年前3
 CakePHP Cookbook Documentation 5.xAdd a pattern value detector. $this->request->addDetector( 'iphone', ['env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i'] ); // Add an option detector $this->request->addDetector('internalIp' Check to see whether the request is via SSL. is('flash') Check to see whether the request has a User-Agent of Flash. is('json') Check to see whether the request has ‘json’ extension and accept ‘application/json’ request. For example: // Get the header as a string $userAgent = $this->request->getHeaderLine('User-Agent'); // Get an array of all values. $acceptHeader = $this->request->getHeader('Accept'); // Check0 码力 | 1080 页 | 939.39 KB | 1 年前3
 CakePHP Cookbook Documentation 5.x); // Add a pattern value detector. $this->request->addDetector( 'iphone', ['env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i'] (continues on next page) 168 Chapter 9. Request & Response Objects to see whether the request is via SSL. • is('flash') Check to see whether the request has a User-Agent of Flash. • is('json') Check to see whether the request has ‘json’ extension and accept ‘application/json’ request. For example: // Get the header as a string $userAgent = $this->request->getHeaderLine('User-Agent'); // Get an array of all values. $acceptHeader = $this->request->getHeader('Accept'); // Check0 码力 | 848 页 | 2.53 MB | 1 年前3
共 8 条
- 1
 













