Module data types
Module scripts allow you to accept input parameters in a certain way. The principle of operation and the way these parameters are passed are explained in detail in the"Module Scripts" section.
All values passed to the module via the HTML template must be passed comma-separated and in a safe representation, i.e. encoded with the PHP function urlencode(). If you use keys like {NAME} as parameters, they will be automatically encoded if specified in square brackets: [NAME], more details in"System Keys".
For each input parameter you can define a data type, from the following list:
| Type | Description | Example data type |
|---|---|---|
| int | Integer numbers. For example, id: int | 5432 |
| bool | Binary Boolean type with possible values true and false. For example, visible: bool | true |
| float | Floating point numbers with a dot separator. For example, price: float | 1.234 |
| str | A string with character data. For example, name: str | milk |
| fix | A fixed data type, then the list of possible values is strictly defined. After specifying this type, you must list the list of possible values through the equal sign, through the symbol"|". For example, let's define the variable var: fix=zero|plus|minus | plus |
| serial | This is a special representation of complex data, such as a dynamic array with data. In some ways it resembles the JSON data storage format, but it is more convenient thanks to PHP's built-in serialize() and unserialize() functions. This data type is mainly used when directly calling a module from the root script. For example, the index.php root script calls the melbis_base_topic module by passing two variables as parameters : get: serial and post: serial. Both are arrays and can have a variety of data, with different queries. | a:7:{s:6: "amount"; |

Melbis Shop6