Skip to content
Last updated

WHMCS\Module\Server\CustomAction

Class

Methods

factory

public static function factory(string $identifier, string $display, $callable, array $params = [], array $permissions = [], bool $active = true, bool $allowSamePage = false, bool $preferIsolation = false): CustomAction

Initialise the CustomAction object providing the data that will be used on output.

Parameters

TypeNameDescription
string$identifierThe string used to identify the CustomAction object.
string$displayThe string displayed in the Client Area.
mixed$callableThe invoked function when interacting with the CustomAction object.
array$paramsAn array of parameters to be used when the provided function is called.
array$permissionsAn array of permissions required to see and click the CustomAction object.
bool$activeA boolean representing whether the CustomAction should be disabled on render.
bool$allowSamePageSet to true if the result of custom action can be rendered on the same page

Returns CustomAction

getIdentifier

public function getIdentifier(): string

Get the identifier for the CustomAction object.

Returns string

getDisplay

public function getDisplay(): string

Get the display for the CustomAction object.

Returns string

invokeCallable

public function invokeCallable(): array

Invoke the callable function for the CustomAction object.

Returns array

getPermissions

public function getPermissions(): array

Get the permissions for the CustomAction object.

Returns string[]

isActive

public function isActive(): bool

Returns bool

isAllowSamePage

public function isAllowSamePage(): bool

Returns bool

isPreferIsolation

public function isPreferIsolation(): bool

Returns bool