Elgg
Version master
|
Go to the source code of this file.
Functions | |
elgg_register_action (string $action, string $filename= '', string $access= 'logged_in', array $params=[]) | |
Elgg Actions. More... | |
elgg_unregister_action (string $action) | |
Unregisters an action. More... | |
elgg_build_hmac ($data) | |
Get an HMAC token builder/validator object. More... | |
elgg_action_exists (string $action) | |
Check if an action is registered and its script exists. More... | |
elgg_is_xhr () | |
Checks whether the request was requested via ajax. More... | |
elgg_action_exists | ( | string | $action | ) |
Check if an action is registered and its script exists.
string | $action | Action name |
Definition at line 68 of file actions.php.
elgg_build_hmac | ( | $data | ) |
Get an HMAC token builder/validator object.
mixed | $data | HMAC data string or serializable data |
Definition at line 56 of file actions.php.
elgg_is_xhr | ( | ) |
Checks whether the request was requested via ajax.
Definition at line 78 of file actions.php.
elgg_register_action | ( | string | $action, |
string | $filename = '' , |
||
string | $access = 'logged_in' , |
||
array | $params = [] |
||
) |
Elgg Actions.
Registers an action.
Actions are registered to a script in the system and are executed by the URL http://elggsite.org/action/action_name/.
$filename must be the full path of the file to register or a path relative to the core actions/ dir.
Actions should be namespaced for your plugin. Example: elgg_register_action('myplugin/save_settings', ...);
Put action files under the actions/<plugin_name> directory of your plugin.
You don't need to use Elgg in your action files.
string | $action | The name of the action (eg "register", "account/settings/save") |
string | $filename | Optionally, the filename where this action is located. If not specified, will assume the action is in elgg/actions/<action>.php |
string | $access | Who is allowed to execute this action: public, logged_in, admin. (default: logged_in) |
array | $params | Additional params for the action route registration:
|
Definition at line 34 of file actions.php.
elgg_unregister_action | ( | string | $action | ) |
Unregisters an action.
string | $action | Action name |
Definition at line 45 of file actions.php.