Skip to content

Commit

Permalink
Expand doc blocks more.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed May 30, 2014
1 parent 447aa19 commit ad2f11e
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions src/Controller/Component/CookieComponent.php
Expand Up @@ -140,6 +140,23 @@ public function __construct(ComponentRegistry $collection, array $config = array
/**
* Set the configuration for a specific top level key.
*
* ### Examples:
*
* Set a single config option for a key:
*
* {{{
* $this->Cookie->configKey('User', 'expires', '+3 months');
* }}}
*
* Set multiple options:
*
* {{{
* $this->Cookie->configKey('User', [
* 'expires', '+3 months',
* 'httpOnly' => true,
* ]);
* }}}
*
* @param string $keyname The top level keyname to configure.
* @param null|string|array $option Either the option name to set, or an array of options to set,
* or null to read config options for a given key.
Expand Down Expand Up @@ -168,10 +185,7 @@ public function implementedEvents() {
}

/**
* Write a value to the $_COOKIE[$key];
*
* By default all values are encrypted.
* You must pass $encrypt false to store values in clear test
* Write a value to the response cookies.
*
* You must use this method before any output is sent to the browser.
* Failure to do so will result in header already sent errors.
Expand Down Expand Up @@ -205,6 +219,9 @@ public function write($key, $value = null) {
/**
* Read the value of key path from request cookies.
*
* This method will also allow you to read cookies that have been written in this
* request, but not yet sent to the client.
*
* @param string $key Key of the value to be obtained. If none specified, obtain map key => values
* @return string or null, value for specified key
* @link http://book.cakephp.org/2.0/en/core-libraries/components/cookie.html#CookieComponent::read
Expand Down Expand Up @@ -253,9 +270,8 @@ public function check($key = null) {
* You must use this method before any output is sent to the browser.
* Failure to do so will result in header already sent errors.
*
* This method will delete both the top level and 2nd level cookies set.
* For example assuming that $name = App, deleting `User` will delete
* both `App[User]` and any other cookie values like `App[User][email]`
* Deleting a top level key will delete all keys nested within that key.
* For example deleting the `User` key, will also delete `User.email`.
*
* @param string $key Key of the value to be deleted
* @return void
Expand Down

0 comments on commit ad2f11e

Please sign in to comment.