Extensions > ajax
Simplier and faster usage of AJAX in TYPOlight.
This extension adds a helper script "ajax.php" to the system root. Using this script allows you to make Ajax-requests a lot simplier. This extension is provided for other developers to use in their extensions!
ajax.php can be used in the Mootools Request-Class as an url. To run the default features, you only need to pass two GET-parameters:
- action: The action to execute, can be either "fmd" (Frontend Module), "cte" (Content Element) or "ffl" (Form field).
- id: The ID of your class.
By passing those two parameters, the function called generateAjax() is called on your Module/Content Element/Widget. This allows you to switch the template or trigger future actions. A simple example can be found in the calendarbanner extension.
Special case "Widget"
Compared to frontend modules and content elements, a widget does not (have to) be in the database. This means the ID cannot match a data record. When generating the widget you should set the $_SESSION['AJAX-FFL'] array with the required data. An example can be found in the extension FancyUpload (Release 2).