aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docs/en/developers/03_Backend/05_Extensions.md
diff options
context:
space:
mode:
authorAlexis Degrugillier <aledeg@users.noreply.github.com>2021-01-09 14:49:45 -0500
committerGitHub <noreply@github.com>2021-01-09 20:49:45 +0100
commitf5fdbb9e8211500ce8ffc959808b7891646f9f3c (patch)
treebe6343f5ff7e19883b9a17fa068afc7aa2439095 /docs/en/developers/03_Backend/05_Extensions.md
parent896f9d33637ec510937bc13a34f98f669795ab49 (diff)
downloadfreshrss-f5fdbb9e8211500ce8ffc959808b7891646f9f3c.tar.gz
freshrss-f5fdbb9e8211500ce8ffc959808b7891646f9f3c.zip
Add class autoload for extension (#3350)
When an extension defines an `autoload` method, it will be registered automatically before enabling the extension. For the extension creator, it's easier because there is no need to register it manually.
Diffstat (limited to 'docs/en/developers/03_Backend/05_Extensions.md')
-rw-r--r--docs/en/developers/03_Backend/05_Extensions.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/en/developers/03_Backend/05_Extensions.md b/docs/en/developers/03_Backend/05_Extensions.md
index 1ddfdb208..e280f9c0b 100644
--- a/docs/en/developers/03_Backend/05_Extensions.md
+++ b/docs/en/developers/03_Backend/05_Extensions.md
@@ -296,6 +296,11 @@ In addition, you will have a number of methods directly inherited from `Minz_Ext
* `getFileUrl($filename, $type)` will return the URL to a file in the `static` directory. The first parameter is the name of the file (without `static /`), the second is the type of file to be used (`css` or` js`).
* `registerController($base_name)` will tell Minz to take into account the given controller in the routing system. The controller must be located in your `Controllers` directory, the name of the file must be` <base_name>Controller.php` and the name of the `FreshExtension_<base_name>_Controller` class.
+> If your extension code is scattered in different classes, you need to load their source before using them.
+> Of course you could include the files manually, but it's more efficient to load them automatically.
+> To do so, you just need to define the `autoload` method which will include them when needed.
+> This method will be registered automatically when the extension is enabled.
+
**TODO**
* `registerViews()`