Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:back:start [2025/09/03 14:41] – Automatic translation caprel | en:back:start [2025/09/03 14:44] (current) – Automatic translation caprel | ||
---|---|---|---|
Line 5: | Line 5: | ||
So when you deploy dolimobile in your dolibarr module you will have a few new folders that will appear: | So when you deploy dolimobile in your dolibarr module you will have a few new folders that will appear: | ||
- | * `mobile`: the folder | + | * '' |
- | * `pwa` : the folder | + | * '' |
- | * smartmaker-api`: the folder in which you will store the php controllers and mappers for your objects, which will be accessible via the api.php router in the `pwa` folder. | + | * '' |
- | As well as a `smartmaker-api-prepend.php` file which is used to factorise code and avoid having | + | As well as a file '' |
+ | ##Mapping dolibarr <-> react application | ||
- | ##Mapping dolibarr <-> application react | + | Dolibarr objects can't be directly transposed into react, so we've developed a mapping system that matches |
- | + | ||
- | Dolibarr objects can't be directly transposed into react, so we've developed a mapping system that lets you map dolibarr objects | + | |
Each dolibarr class that needs to be mapped can be mapped using a set of fine-tuned techniques, details of which can be found below. | Each dolibarr class that needs to be mapped can be mapped using a set of fine-tuned techniques, details of which can be found below. | ||
Line 21: | Line 20: | ||
If your module provides a SmartInter object, for example, you can map its fields to react simply by implementing a dmSmartInter file. | If your module provides a SmartInter object, for example, you can map its fields to react simply by implementing a dmSmartInter file. | ||
- | More details on the [[mapping dolibarr < | + | More details on the [[back: |
##api.php file | ##api.php file | ||
Line 33: | Line 32: | ||
* Route:: | * Route:: | ||
* action can be get post or put (delete is not yet implemented) | * action can be get post or put (delete is not yet implemented) | ||
- | * the 1st argument of the function is the name of the entry point you want on your api, so `Route:: | + | * the 1st argument of the function is the name of the entry point you want on your api, for example '' |
* the next argument gives the name of the PHP class to be requested | * the next argument gives the name of the PHP class to be requested | ||
* the next argument contains the name of the function to be used in this PHP class | * the next argument contains the name of the function to be used in this PHP class | ||
- | * the last argument indicates whether | + | * the last argument indicates whether |
This PHP router makes it extremely easy to ' | This PHP router makes it extremely easy to ' | ||
- | For example, a `GET /login` calls the `index` function of the `AuthController` class and a `POST /login` calls the `login` function of the same class ... | + | For example, a '' |
``` | ``` | ||
Line 55: | Line 54: | ||
``` | ``` | ||
- | And implement the `logout` function in your `AuthController` class ... | + | And implement the '' |
``` | ``` |