]> git.mxchange.org Git - friendica.git/blob - src/Module/README.md
Update README for Modules
[friendica.git] / src / Module / README.md
1 ## Friendica\Module
2
3 The Module namespace contains the different modules of Friendica.
4 Each module is loaded through the [`App`](https://github.com/friendica/friendica/blob/develop/src/App.php).
5
6 There are mainly two types of modules:
7 -       frontend modules to interact with users
8 -       backend modules to interact with machine requests
9
10 ### Frontend modules
11
12 This type of modules mainly needs a template, which are generally located at
13 [view/templates/](https://github.com/friendica/friendica/tree/develop/view/templates).
14
15 A frontend module should extend the [`BaseModule`](https://github.com/friendica/friendica/blob/develop/src/BaseModule.php), especially the `content()` method. 
16
17 ### Backend modules
18
19 This type of modules mainly responds either with `XML` or with `JSON`. 
20
21 Rules for Modules:
22 -       Named like the call (i.e. https://friendica.test/contact => `Contact`)
23 -       Start with capitals and are **not** camelCased.
24 -       Directly interacting with a given request (POST or GET)
25 -       Extending [`BaseModule`](https://github.com/friendica/friendica/blob/develop/src/BaseModule.php).