Actions are the primary way users interact with an Elgg site.
An action in Elgg is the code that runs to make changes to the database when a user does something. For example, logging in, posting a comment, and making a blog post are actions. The action script processes input, makes the appropriate modifications to the database, and provides feedback to the user about the action.
Actions are registered during the boot process by calling
elgg_register_action(). All actions URLs start with
action/ and are served by Elgg’s front end controller through the action service. This approach is different from traditional PHP applications that send information to a specific file. The action service performs CSRF security checks, and calls the registered action script file, then optionally forwards the user to a new page. By using the action service instead of a single script file, Elgg automatically provides increased security and extensibility.
In Elgg 1.8 and before, actions were handled by an action handler script in
`engine/handlers/action_handler.php. This required specific rewrite rules for URLs beginning with
See Forms + Actions for details on how to register and construct an action. To look at the core actions, check out the directory /actions.