Content - News Menu - Ressources Menu - Sitemap - Share your code - Code library - Reference
Formidable is part of the TYPO3 Project and is supported by Ameos
The datasource:DB is used when you need to make a SQL query and to quickly get all the information you'll need.
| path | data type | req | def | uobj | description |
|---|---|---|---|---|---|
| name | string | X |
The datasource name. Has to be unique in the application. | ||
| sql | string | X |
The SQL query to be executed by the datasource. No ORDER BY nor LIMIT statements allowed. Example:
| ||
| table | string |
Database table. Example:
| |||
| fields | string |
List of fields to be queried. Example:
| |||
| wheres | wheres-section |
Additional conditions to be added to the query. Example:
| |||
| enableFields | string |
Adds enable fields to the sql query automatically (typically hidden=0 and deleted=0). If string given, will be interpreted as the DB table on which to check for enableFields. If true, the datasource will try to automatically determine the table name for enablefields. If you have a SQL with more than one table, then you must set manually the enableFields, like this:
| |||
| beforeSqlFilter | runneable | X |
Allows to alter the raw data array that will be used to build the SQL parts, before building the whole query.
| ||
| beforeSqlExec | runneable | X |
Allows to alter the array that will be used to build the whole SQL query, before execution.
| ||
| writable | boolean | false |
Datasource can insert or update record in database. The renderlet which use the datasource set a key. Example
| ||
| beforeInsertion | runneable | X |
Alters the array of data, before insertion into the database.
| ||
| afterInsertion | runneable | X |
Alters the array of data, after insertion into the database.
| ||
| beforeEdition | runneable | X |
Alters the array of data, before insertion into the database, only if the record already exists in the database.
| ||
| afterEdition | runneable | X |
Alters the array of data, after insertion into the database, only if the record already exists in the database.
| ||
| beforeCreation | runneable | X |
Alters the array of data, before insertion into the database, only if the record don't exists in the database and is about to be created.
| ||
| afterCreation | runneable | X |
Alters the array of data, after insertion into the database, only if the record has just been created.
| ||
| link/ : Connects to an alternative DB if needed. | |||||
| link/host | string | Name or IP of the server hosting the alternative DB to connect to. | |||
| link/user | string | Alternative DB username. | |||
| link/password | string | Alternative DB password. | |||
| link/dbName | string | Alternative DB name. | |||
Provided by Ameos
1). The following example presents how to create a datasource which is listing all the online users:
2). The bellow datasource will display all the countries which name is starting with the letter "A":