upd: notice.api:3.0 (added new references)

This commit is contained in:
xdrm-brackets 2017-12-13 00:16:46 +01:00
parent 0c0ec01314
commit dde577f008
1 changed files with 7 additions and 4 deletions

View File

@ -257,7 +257,7 @@ The *is_optional* field must be a **boolean** set to `true` if the parameter can
#### parameter.rename #### parameter.rename
The *rename* field must be a **string** corresponding to the *variable name* given to the implementation. It is useful for **GET parameters** because they need to be called `URL#`, where `#` is the position in the URI. The *rename* field must be a **string** corresponding to the *variable name* given to the implementation. It is useful for **GET parameters** because they need to be called `URL#`, where `#` is the position in the URI. (cf. [paramter.name](#parametername)))
If ommited, by default, `parameter.name` will be used. If ommited, by default, `parameter.name` will be used.
#### parameter.default_value #### parameter.default_value
@ -312,6 +312,8 @@ Also the **namespace** must match, it corresponds to the path (starting at `/api
For instance if you have in your configuration a path called `/uri1/uri2/uri3`, you will create the file `/build/api/module/uri1/uri2/uri3.php`. For instance if you have in your configuration a path called `/uri1/uri2/uri3`, you will create the file `/build/api/module/uri1/uri2/uri3.php`.
*Specific*: For the root (`/`) path, it will trigger the class `\api\module\root`, so you have to create the file `/build/api/module/root.php`. (cf. [configuration format](#1---configuration-format))
### methods ### methods
@ -322,9 +324,9 @@ Each method is represented as a class' method with the same name as the associat
Arguments are passed to the method as a single argument which an associative array according to the configuration. Arguments are passed to the method as a single argument which an associative array according to the configuration.
_Notes_: _Notes_:
* Optional parameters if not given are set to the `default` value given in the configuration (`null` if) * Optional parameters if not given are set to their default value (cf. [parameter.optional](#parameterisoptional), [parameter.default_value](#parameterdefault_value))
* parameters of type `FILE` are given by reference but the use is the same as normal parameters * parameters of type `FILE` are given by reference but the use is the same as normal parameters (cf. [complex types](#2---complex-types))
* URI parameters are called `URL0`, `URL1` and so on according to their order if no `rename` set in the configuration. * URI parameters are called `URL0`, `URL1` and so on according to their order if no `rename` set in the configuration. (cf: [parameter.name](#parametername), [parameter.rename](#parameterrename))
### return statement ### return statement
@ -404,6 +406,7 @@ To add a new type, just open the file `/build/api/Checker.php` and add an entry
|Type|Sub-Type|Description| |Type|Sub-Type|Description|
|---|---|---| |---|---|---|
|`array<a>`|`a`|Array containing only entries matching the type `a`| |`array<a>`|`a`|Array containing only entries matching the type `a`|
|`FILE`|_a raw file send in `multipart/form-data`|A raw file sent by `multipart/form-data`|
> **Note:** It is possible to chain `array` type as many as needed. > **Note:** It is possible to chain `array` type as many as needed.