PHP Class Crud\Listener\RedirectListener

Listener to improve upon the default redirection behavior of Crud actions Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt
Inheritance: extends BaseListener
Datei anzeigen Open project: friendsofcake/crud

Protected Properties

Property Type Description
$_defaultConfig array Settings

Public Methods

Method Description
beforeRedirect ( Cake\Event\Event $event ) : void Redirect callback
implementedEvents ( ) : array Returns a list of all events that will fire in the controller during its lifecycle.
reader ( string $key, mixed $reader = null ) : mixed Add or replace a reader
setup ( ) : void Setup method

Protected Methods

Method Description
_getKey ( Crud\Event\Subject $subject, string $reader, string $key ) : mixed Return the value of $type with $key
_getUrl ( Crud\Event\Subject $subject, array $url ) : array Get the new redirect URL

Method Details

_getKey() protected method

Return the value of $type with $key
protected _getKey ( Crud\Event\Subject $subject, string $reader, string $key ) : mixed
$subject Crud\Event\Subject Subject
$reader string Reader
$key string Key
return mixed

_getUrl() protected method

Expand configurations where possible and replace the placeholder with the actual value
protected _getUrl ( Crud\Event\Subject $subject, array $url ) : array
$subject Crud\Event\Subject Subject
$url array URL
return array

beforeRedirect() public method

If a special redirect key is provided, change the redirection URL target
public beforeRedirect ( Cake\Event\Event $event ) : void
$event Cake\Event\Event Event
return void

implementedEvents() public method

You can override this function to add your own listener callbacks
public implementedEvents ( ) : array
return array

reader() public method

Add or replace a reader
public reader ( string $key, mixed $reader = null ) : mixed
$key string Key
$reader mixed Reader
return mixed

setup() public method

Called when the listener is initialized Setup the default readers
public setup ( ) : void
return void

Property Details

$_defaultConfig protected_oe property

Settings
protected array $_defaultConfig
return array