\Charcoal\App\ActionActionInterface

Summary

Methods
Constants
__invoke()
setDependencies()
setData()
setMode()
mode()
setSuccess()
success()
setSuccessUrl()
successUrl()
setFailureUrl()
failureUrl()
redirectUrl()
results()
run()
init()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

__invoke()

__invoke(\Psr\Http\Message\RequestInterface  $request, \Psr\Http\Message\ResponseInterface  $response) : \Psr\Http\Message\ResponseInterface

Actions are callable, with http request and response as parameters.

Parameters

\Psr\Http\Message\RequestInterface $request

A PSR-7 compatible Request instance.

\Psr\Http\Message\ResponseInterface $response

A PSR-7 compatible Response instance.

Returns

\Psr\Http\Message\ResponseInterface

setDependencies()

setDependencies(\Pimple\Container  $container) : void

Give an opportunity to children classes to inject dependencies from a Pimple Container.

Does nothing by default, reimplement in children classes.

The $container DI-container (from Pimple) should not be saved or passed around, only to be used to inject dependencies (typically via setters).

Parameters

\Pimple\Container $container

A dependencies container instance.

mode()

mode() : string

Returns

string

setSuccess()

setSuccess(boolean  $success) : \Charcoal\App\Action\ActionInterface

Parameters

boolean $success

Success flag (true / false).

Returns

\Charcoal\App\Action\ActionInterface

Chainable

success()

success() : boolean

Returns

boolean

setSuccessUrl()

setSuccessUrl(string  $url) : \Charcoal\App\Action\ActionInterface

Parameters

string $url

The success URL.

Returns

\Charcoal\App\Action\ActionInterface

Chainable

successUrl()

successUrl() : string

Returns

string

setFailureUrl()

setFailureUrl(string  $url) : \Charcoal\App\Action\ActionInterface

Parameters

string $url

The success URL.

Returns

\Charcoal\App\Action\ActionInterface

Chainable

failureUrl()

failureUrl() : string

Returns

string

redirectUrl()

redirectUrl() : string

Returns

string

results()

results() : array

Returns

array

run()

run(\Psr\Http\Message\RequestInterface  $request, \Psr\Http\Message\ResponseInterface  $response) : \Psr\Http\Message\ResponseInterface

Parameters

\Psr\Http\Message\RequestInterface $request

A PSR-7 compatible Request instance.

\Psr\Http\Message\ResponseInterface $response

A PSR-7 compatible Response instance.

Returns

\Psr\Http\Message\ResponseInterface

init()

init(\Psr\Http\Message\RequestInterface  $request) : boolean

Initialize the action with a request.

Parameters

\Psr\Http\Message\RequestInterface $request

The request to initialize.

Returns

boolean —

Success / Failure.