[Pkg-owncloud-commits] [owncloud-doc] 41/43: small REST addition
David Prévot
taffit at alioth.debian.org
Tue Aug 20 11:56:14 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch dfsg_clean
in repository owncloud-doc.
commit ed59a5b7a433897fe1e8118b8aa38ef390c588b3
Author: Bernhard Posselt <nukeawhale at gmail.com>
Date: Sat Aug 17 12:49:37 2013 +0200
small REST addition
---
developer_manual/app/appframework/controllers.rst | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/developer_manual/app/appframework/controllers.rst b/developer_manual/app/appframework/controllers.rst
index 729bd66..cf105b8 100644
--- a/developer_manual/app/appframework/controllers.rst
+++ b/developer_manual/app/appframework/controllers.rst
@@ -3,7 +3,7 @@ Controllers
.. sectionauthor:: Bernhard Posselt <nukeawhale at gmail.com>
-The App Framework provides a simple baseclass for adding controllers: :php:class:`OCA\\AppFramework\\Controller\\Controller`. Controllers connect your view (templates) with your database. Controllers themselves are connected to one or more routes. Controllers go into the **controller/** directory.
+The App Framework provides a simple baseclass for adding controllers: :php:class:`OCA\\AppFramework\\Controller\\Controller`. Controllers connect your view (templates) with your database and contain the logic of your app. Controllers themselves are connected to one or more routes. Controllers go into the **controller/** directory.
A controller should be created for each resource. Think of it as an URL scheme::
@@ -11,9 +11,9 @@ A controller should be created for each resource. Think of it as an URL scheme::
For instance::
- /file/delete/1
+ /file/1
-In this case we would create a controller named **FileController** and the method would be called **delete()**.
+In this case we would create a controller named **FileController** and the method would be called **get()**.
A simple controller would look like:
@@ -46,9 +46,7 @@ A simple controller would look like:
* sets a global system value
*/
public function myControllerMethod(){
- $value = $this->params('somesetting');
-
- return new JSONResponse(array('value' => $value));
+ return new JSONResponse(array('value' => $this->params('somesetting')));
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-doc.git
More information about the Pkg-owncloud-commits
mailing list