Elgg  Version 4.3
Public Member Functions | Protected Attributes | List of all members
Elgg\ActionsService Class Reference

Actions service. More...

Public Member Functions

 __construct (RouteRegistrationService $routes, HandlersService $handlers)
 Constructor. More...
 
 register (string $action, $handler= '', string $access= 'logged_in')
 Registers an action. More...
 
 unregister (string $action)
 Unregisters an action. More...
 
 exists (string $action)
 Check if an action is registered and its script exists. More...
 
 getAllActions ()
 Get all actions. More...
 

Protected Attributes

 $routes
 
 $handlers
 

Detailed Description

Actions service.

Definition at line 20 of file ActionsService.php.

Constructor & Destructor Documentation

Elgg\ActionsService::__construct ( RouteRegistrationService  $routes,
HandlersService  $handlers 
)

Constructor.

Parameters
RouteRegistrationService$routesRoutes
HandlersService$handlersHandlers service

Definition at line 53 of file ActionsService.php.

Member Function Documentation

Elgg\ActionsService::exists ( string  $action)

Check if an action is registered and its script exists.

Parameters
string$actionAction name
Returns
bool
See also
elgg_action_exists()

Definition at line 152 of file ActionsService.php.

Elgg\ActionsService::getAllActions ( )

Get all actions.

Returns
array

Definition at line 182 of file ActionsService.php.

Elgg\ActionsService::register ( string  $action,
  $handler = '',
string  $access = 'logged_in' 
)

Registers an action.

Parameters
string$actionThe name of the action (eg "register", "account/settings/save")
string | callable$handlerOptionally, the filename where this action is located. If not specified, will assume the action is in elgg/actions/<action>.php
string$accessWho is allowed to execute this action: public, logged_in, logged_out, admin. (default: logged_in)
Returns
bool
See also
elgg_register_action()

Definition at line 71 of file ActionsService.php.

Elgg\ActionsService::unregister ( string  $action)

Unregisters an action.

Parameters
string$actionAction name
Returns
bool
See also
elgg_unregister_action()

Definition at line 131 of file ActionsService.php.

Member Data Documentation

Elgg\ActionsService::$handlers
protected

Definition at line 45 of file ActionsService.php.

Elgg\ActionsService::$routes
protected

Definition at line 40 of file ActionsService.php.


The documentation for this class was generated from the following file: