========= Templates ========= .. sectionauthor:: Bernhard Posselt Nextcloud provides its own templating system which is basically plain PHP with some additional functions and preset variables. All the parameters which have been passed from the :doc:`controller <../controllers>` are available in an array called **$_[]**, e.g.:: array('key' => 'something') can be accessed through:: $_['key'] .. note:: To prevent XSS the following PHP **functions for printing are forbidden: echo, print() and

inc('templateName')** method. .. code-block:: php inc('sub.inc')); ?> The parent variables will also be available in the included templates, but should you require it, you can also pass new variables to it by using the second optional parameter as array for **$this->inc**. :file:`templates/sub.inc.php` .. code-block:: php
I am included, but I can still access the parents variables!
inc('other_template', array('variable' => 'value'))); ?> Including CSS and JavaScript ---------------------------- .. warning:: This is deprecated, please use ``addScript`` and ``addStyle`` in your controller instead. See :ref:`ApplicationJs` for more information. To include CSS or JavaScript use the **style** and **script** functions: .. code-block:: php " />