메소드 |
설명 |
|
autoPostRedirect ( mixed $whereTo, boolean $conditionalAutoRedirect = true, integer $status = 302 ) : Response |
Combine auto with post
also allows whitelisting certain actions for autoRedirect (use Controller::$autoRedirectActions) |
|
autoRedirect ( mixed $whereTo, boolean $allowSelf = false, integer $status = 302 ) : Response |
Smart Referer Redirect - will try to use an existing referer first
otherwise it will use the default url |
|
completeRedirect ( mixed | null $url = null, integer | null $status = 302 ) : Response |
Automatically add missing URL parts of the current URL including
- querystring (especially for 3.x then)
- passed params |
|
currentUrl ( boolean $asString = false ) : mixed |
Returns current url (with all missing params automatically added). |
|
defaultUrlParams ( ) : array |
Returns defaultUrlParams including configured prefixes. |
|
forceCache ( integer $seconds = HOUR ) : void |
Set headers to cache this request. |
|
getPassedParam ( mixed $var, mixed $default = null ) : mixed |
Used to get the value of a passed param. |
|
isForeignReferer ( string | null $ref = null ) : boolean |
Referrer checking (where does the user come from)
Only returns true for a valid external referrer. |
|
isPosted ( ) : boolean |
Convenience method to check on POSTED data. |
|
listActions ( ) : array |
List all direct actions of a controller |
|
loadComponent ( string $component, array $config = [], boolean $callbacks = true ) : void |
Add component just in time (inside actions - only when needed)
aware of plugins and config array (if passed) |
|
loadHelper ( mixed $helpers = [] ) : void |
Add helper just in time (inside actions - only when needed)
aware of plugins |
|
postRedirect ( mixed $whereTo, integer $status = 302 ) : Response |
Should be a 303, but:
Note: Many pre-HTTP/1.1 user agents do not understand the 303 status. When interoperability with such clients is a concern, the 302 status code may be used instead, since most user agents react to a 302 response as described here for 303. |
|
startup ( Cake\Event\Event $event ) : void |
For this helper the controller has to be passed as reference
for manual startup with $disableStartup = true (requires this to be called prior to any other method) |
|