class Action (View source)

Constants

INJECTION_EXCEPTION_TYPE

Methods

__construct(array $namespaces, array $middlewares)

Action constructor

static Action
configure(array $namespaces, array $middlewares)

Action configuration

static Action
getInstance()

Retrieves Action instance

pushMiddleware(array|callable $middlewares, bool $end = false)

Add a middleware to the list

pushNamespace(array|string $namespace)

Adding a namespace to the list

mixed
call(callable|string|array $actions, mixed $param = null)

Callback launcher

mixed
execute(array|callable $arr, array|callable $arg)

Successively launches a function list.

array
controller(string $controller_name)

Load the controllers defined as string

array
closure(Closure $closure)

Load the closure define as action

array
injector(string $classname, string $method = null)

Make any class injection

array
injectorForClosure(callable $closure)

Injection for closure

Details

__construct(array $namespaces, array $middlewares)

Action constructor

Parameters

array $namespaces
array $middlewares

static Action configure(array $namespaces, array $middlewares)

Action configuration

Parameters

array $namespaces
array $middlewares

Return Value

Action

static Action getInstance()

Retrieves Action instance

Return Value

Action

pushMiddleware(array|callable $middlewares, bool $end = false)

Add a middleware to the list

Parameters

array|callable $middlewares
bool $end

pushNamespace(array|string $namespace)

Adding a namespace to the list

Parameters

array|string $namespace

mixed call(callable|string|array $actions, mixed $param = null)

Callback launcher

Parameters

callable|string|array $actions
mixed $param

Return Value

mixed

Exceptions

RouterException
ReflectionException

mixed execute(array|callable $arr, array|callable $arg)

Successively launches a function list.

Parameters

array|callable $arr
array|callable $arg

Return Value

mixed

Exceptions

ReflectionException

array controller(string $controller_name)

Load the controllers defined as string

Parameters

string $controller_name

Return Value

array

Exceptions

ReflectionException

array closure(Closure $closure)

Load the closure define as action

Parameters

Closure $closure

Return Value

array

array injector(string $classname, string $method = null)

Make any class injection

Parameters

string $classname
string $method

Return Value

array

Exceptions

ReflectionException

array injectorForClosure(callable $closure)

Injection for closure

Parameters

callable $closure

Return Value

array

Exceptions