From e0854b965c92bff8dc2875136fc03b7792bd9a95 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sat, 16 Mar 2013 15:31:53 -0400 Subject: [PATCH 1/2] also take care of cookie method --- developer_manual/app/appframework/controllers.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/developer_manual/app/appframework/controllers.rst b/developer_manual/app/appframework/controllers.rst index 44dac65a8..5eeb02796 100644 --- a/developer_manual/app/appframework/controllers.rst +++ b/developer_manual/app/appframework/controllers.rst @@ -61,7 +61,11 @@ An instance of the API is passed via :doc:`../general/dependencyinjection`, the .. note:: If an URL Parameter, POST or GET value exist with the same key, the URL Parameter is preferred over the POST parameter and the POST parameter is preferred over the GET parameter. You should avoid this scenario though. -If you want to get variables from env variables, use **$this->env($key)** and for session variables, use **$this->session($key)**. +If you want to access env variables, use **$this->env($key)**. Session and +cookie variables can be manipulated via **session** and **cookie** methods. For +example, to get a value of variable from session: +**$this->session($key_name)**. To set a variable in cookie: +**$this->cookie($key_name, $value_name)**. Every controller method has to return a Response object. The currently available Responses from the App Framework include: From f5e98c033e164edeb251aa96c2e10f0383d1b491 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sat, 16 Mar 2013 16:27:26 -0400 Subject: [PATCH 2/2] update cookie method to latest api --- developer_manual/app/appframework/controllers.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/developer_manual/app/appframework/controllers.rst b/developer_manual/app/appframework/controllers.rst index 5eeb02796..8dc6be78c 100644 --- a/developer_manual/app/appframework/controllers.rst +++ b/developer_manual/app/appframework/controllers.rst @@ -61,11 +61,12 @@ An instance of the API is passed via :doc:`../general/dependencyinjection`, the .. note:: If an URL Parameter, POST or GET value exist with the same key, the URL Parameter is preferred over the POST parameter and the POST parameter is preferred over the GET parameter. You should avoid this scenario though. -If you want to access env variables, use **$this->env($key)**. Session and -cookie variables can be manipulated via **session** and **cookie** methods. For -example, to get a value of variable from session: -**$this->session($key_name)**. To set a variable in cookie: -**$this->cookie($key_name, $value_name)**. +If you want to access environment variables($_ENV), use **$this->env($key)**. +Session and cookie variables can be accessed via **session** and **cookie** +methods. For example, to get a value of a variable from session: +**$this->cookie($key_name)**. Not like cookie, which is read only, session +variables can also be changed using: **$this->session($key_name, +$value_name)**. Every controller method has to return a Response object. The currently available Responses from the App Framework include: