added templates to the tutorial

This commit is contained in:
Bernhard Posselt
2012-11-28 02:58:37 +01:00
parent dd532951d3
commit 8c7488d9e9

View File

@@ -89,7 +89,7 @@ You will want to set certain metainformation for your application. To do that op
'id' => 'yourappname',
// sorting weight for the navigation. The higher the number, the higher
// will it be listed in the navigation
// it will be listed in the navigation
'order' => 74,
// the route that will be shown on startup
@@ -371,6 +371,30 @@ That way you can easily create unittests with a simple API class mock if you don
This will eventually be replaced with an internal Owncloud API layer.
Templates
---------
Templates reside in the **template/** folder. To use them in your controller, use the TemplateResponse class, for instance
.. code-block:: php
<?php
// in your controller
public function index($urlParams=array()){
// main is the template name. Owncloud will look for template/main.php
$response = new TemplateResponse($this->appName, 'main');
$params = array('templateVar' => 1);
$response->setParams($params);
return $response;
}
?>
**For more info, see** :doc:`templates`
JavaScript and CSS
------------------
JavaScript files go to the **js/** directory, CSS files to the **css/** directory. They are both minified in production and must therefore be declared in your controller method.