Cakephp Classroom image

osdyui
 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21|Last
Lessons:-Controllers

CakeRequest::method()
Returns the HTTP method the request was made with.
CakeRequest::onlyAllow($methods)
Set allowed HTTP methods, if not matched will throw MethodNotAllowexException The 405 response
will include the required ‘Allow’ header with the passed methods New in version 2.3.
CakeRequest::referer($local = false)
Returns the referring address for the request.
CakeRequest::clientIp($safe = true)
Returns the current visitor’s IP address.
CakeRequest::header($name)
Allows you to access any of the HTTP_* headers that were used for the request:
$this->request->header(’User-Agent’);
Would return the user agent used for the request.
CakeRequest::input($callback[, $options ])
Retrieve the input data for a request, and optionally pass it through a decoding function. Additional
parameters for the decoding function can be passed as arguments to input().
CakeRequest::data($name)
Provides dot notation access to request data. Allows for reading and modification of request data,
calls can be chained together as well:
// Modify some request data, so you can prepopulate some form fields.
$this->request->data(’Post.title’, ’New post’)
->data(’Comment.1.author’, ’Mark’);
// You can also read out data.
$value = $this->request->data(’Post.title’);
CakeRequest::query($name)
Provides dot notation access to url query data:
// url is /posts/index?page=1&sort=title
$value = $this->request->query(’page’);
New in version 2.3.
CakeRequest::is($type)
Check whether or not a Request matches a certain criteria. Uses the built-in detection rules as well as
any additional rules defined with CakeRequest::addDetector().
CakeRequest::addDetector($name, $options)
Add a detector to be used with is(). See Inspecting the request for more information.
CakeRequest::accepts($type = null)
Find out which content types the client accepts or check if they accept a particular type of content.
Get all types:$this->request->accepts();
Check for a single type:
$this->request->accepts(’application/json’);
static CakeRequest::acceptLanguage($language = null)
Get either all the languages accepted by the client, or check if a specific language is accepted.
Get the list of accepted languages:
CakeRequest::acceptLanguage();
Check if a specific language is accepted:
CakeRequest::acceptLanguage(’es-es’);
property CakeRequest::$data
An array of POST data. You can use CakeRequest::data() to read this property in a way that
suppresses notice errors.
property CakeRequest::$query
An array of query string parameters.
property CakeRequest::$params
An array of route elements and request parameters.
property CakeRequest::$here
Returns the current request uri.
property CakeRequest::$base
The base path to the application, usually / unless your application is in a subdirectory.
property CakeRequest::$webroot
The current webroot.
CakeResponse
CakeResponse is the default response class in CakePHP. It encapsulates a number of features and
functionality for generating HTTP responses in your application. It also assists in testing, as it can be
mocked/stubbed allowing you to inspect headers that will be sent. Like CakeRequest, CakeResponse
consolidates a number of methods previously found on Controller, RequestHandlerComponent
and Dispatcher. The old methods are deprecated in favour of using CakeResponse.
CakeResponse provides an interface to wrap the common response related tasks such as:
• Sending headers for redirects.
• Sending content type headers.
• Sending any header.
• Sending the response body.

 
 
 

osdyui

Skills    Cakephp

Qualifications :-
Location :-,,,
Description:-
Explore
 

  Students (0)