diff --git a/developer_manual/app/init.rst b/developer_manual/app/init.rst index 6c71ee757..2c8deb1fa 100644 --- a/developer_manual/app/init.rst +++ b/developer_manual/app/init.rst @@ -25,7 +25,7 @@ Further pre-app configuration The :file:`appinfo/app.php` is the first file that is loaded and executed in Nextcloud. Depending on the purpose of the app it is usually used to setup things that need to be available on every request to the server, like :doc:`backgroundjobs` and :doc:`hooks` registrations. This is how an example :file:`appinfo/app.php` could look like: .. code-block:: php - + getEventDispatcher(); + + $dispatcher->addListener( + OCP\AppFramework\Http\TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS, + function() { + \OCP\Util::addScript('myapp', 'script'); + \OCP\Util::addStyle('myapp', 'style'); + } + ); Best practice ------------- @@ -68,11 +85,11 @@ lib/AppInfo/Application.php