added appframework api files

This commit is contained in:
Bernhard Posselt
2013-01-26 16:31:08 +01:00
parent 47426f01b5
commit fe3a8d3910
32 changed files with 1196 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ API abstraction layer
.. sectionauthor:: Bernhard Posselt <nukeawhale@gmail.com>
Owncloud currently has a ton of static methods which is a very bad thing concerning testability. Therefore the appframework comes with an API abstraction layer (basically a `facade <http://en.wikipedia.org/wiki/Facade_pattern>`_) which is located in the appframework app at :file:`core/api.php`.
ownCloud currently has a ton of static methods which is a very bad thing concerning testability. Therefore the appframework comes with an :php:class:`OCA\\AppFramework\\Core\\API` abstraction layer (basically a `facade <http://en.wikipedia.org/wiki/Facade_pattern>`_) which is located in the appframework app at :file:`core/api.php`.
If you find yourself in need to use more ownCloud internal static methods, add them to the API class in the appframework directory, like:
@@ -36,4 +36,3 @@ You could of course also simply inherit from the API class and overwrite the API
This will allow you to easily mock the API in your unittests.
.. note:: This will eventually be replaced with an internal Owncloud API layer.

View File

@@ -3,7 +3,7 @@ Controllers
.. sectionauthor:: Bernhard Posselt <nukeawhale@gmail.com>
The appframework app provides a simple baseclass for adding controllers. Controllers connect your view (templates) with your database. Controllers themselves are connected to one or more routes. Controllers go into the :file:`controller` directory.
The appframework app 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 :file:`controller` directory.
A controller should be created for each resource. Think of it as an URL scheme::

View File

@@ -25,6 +25,8 @@ A simple route would look like this:
);
:php:class:`OCA\\AppFramework\\App`
The first argument is the name of your route. This is used as an identifier to get the URL of the route and is a nice way to generate the URL in your templates or JavaScript for certain links since it does not force you to hardcode your URLs. To use it in OC templates, use:
.. code-block:: php