X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FREADME.md;h=a723f6a290756ddcf9ad1b40fae71a050e13cfb9;hb=d27576059670faf87f80eaae2b4560f85b5310fc;hp=66a4967f333e51fc8ec37156b45c3475c8972385;hpb=a338c75c9fe7c1d45d4c7274fafcb59bdc4c3764;p=friendica.git diff --git a/src/Module/README.md b/src/Module/README.md index 66a4967f33..a723f6a290 100644 --- a/src/Module/README.md +++ b/src/Module/README.md @@ -16,10 +16,16 @@ A frontend module should extend the [`BaseModule`](https://github.com/friendica/ ### Backend modules -This type of modules mainly responds either with `XML` or with `JSON`. +This type of modules mainly responds either with encoded `XML` or with `JSON` output. +It isn't intended to respond with human readable text. -Rules for Modules: -- Named like the call (i.e. https://friendica.test/contact => `Contact`) -- Start with capitals and are **not** camelCased. -- Directly interacting with a given request (POST or GET) -- Extending [`BaseModule`](https://github.com/friendica/friendica/blob/develop/src/BaseModule.php). \ No newline at end of file +A frontend module should extend the [`BaseModule`](https://github.com/friendica/friendica/blob/develop/src/BaseModule.php), especially the `rawContent()` method. + +### Routing + +Every module needs to be accessed within a route. +The routes are defined inside [`Router->collectRoutes()`](https://github.com/friendica/friendica/blob/develop/src/App/Router.php). + +Use the given routes as a pattern for further routes. + +The routing library and further documentation can be found [here](https://github.com/nikic/FastRoute). \ No newline at end of file