PHP Class Crud\Action\BaseAction

Licensed under The MIT License For full copyright and license information, please see the LICENSE.txt
Inheritance: extends Crud\Core\Object
Datei anzeigen Open project: friendsofcake/crud

Protected Properties

Property Type Description
$_defaultConfig array Default configuration
$_responding boolean Check if the current action is responding to a request or not

Public Methods

Method Description
disable ( ) : void Disable the Crud action
enable ( ) : void Enable the Crud action
enabled ( ) : boolean Test if a Crud action is enabled or not
handle ( array $args = [] ) : mixed Handle callback
implementedEvents ( ) : array Additional auxiliary events emitted if certain traits are loaded
message ( string $type, array $replacements = [] ) : array return the config for a given message type
publishSuccess ( Cake\Event\Event $event ) : boolean | null Set "success" variable for view.
redirectConfig ( null | string $name = null, null | array $config = null ) : mixed Change redirect configuration
resourceName ( string | null $value = null ) : string Return the human name of the model
responding ( ) : boolean Getter for $_responding
scope ( ) : string Get the action scope
setFlash ( string $type, Crud\Event\Subject $subject ) : void Wrapper for FlashComponent::set()
subjectEntityKey ( ) : string Get entity key

Protected Methods

Method Description
_deriveResourceName ( ) : string Derive resource name

Method Details

_deriveResourceName() protected method

Derive resource name
protected _deriveResourceName ( ) : string
return string

disable() public method

Disable the Crud action
public disable ( ) : void
return void

enable() public method

Enable the Crud action
public enable ( ) : void
return void

enabled() public method

Test if a Crud action is enabled or not
public enabled ( ) : boolean
return boolean

handle() public method

Based on the requested controller action, decide if we should handle the request or not. By returning false the handling is canceled and the execution flow continues
public handle ( array $args = [] ) : mixed
$args array Arguments
return mixed

implementedEvents() public method

Additional auxiliary events emitted if certain traits are loaded
public implementedEvents ( ) : array
return array

message() public method

return the config for a given message type
public message ( string $type, array $replacements = [] ) : array
$type string Message type.
$replacements array Replacements
return array

publishSuccess() public method

Set "success" variable for view.
public publishSuccess ( Cake\Event\Event $event ) : boolean | null
$event Cake\Event\Event Event
return boolean | null

redirectConfig() public method

If both $name and $config is empty all redirection rules will be returned. If $name is provided and $config is null, the named redirection configuration is returned. If both $name and $config is provided, the configuration is changed for the named rule. $config should contain the following keys: - type : name of the reader - key : the key to read inside the reader - url : the URL to redirect to
public redirectConfig ( null | string $name = null, null | array $config = null ) : mixed
$name null | string Name of the redirection rule
$config null | array Redirection configuration
return mixed

resourceName() public method

By default it uses Inflector::humanize, but can be changed using the "name" configuration property
public resourceName ( string | null $value = null ) : string
$value string | null Name to set
return string

responding() public method

Getter for $_responding
public responding ( ) : boolean
return boolean

scope() public method

Usually it's 'table' or 'entity'
public scope ( ) : string
return string

setFlash() public method

Wrapper for FlashComponent::set()
public setFlash ( string $type, Crud\Event\Subject $subject ) : void
$type string Message type
$subject Crud\Event\Subject Event subject
return void

subjectEntityKey() public method

Get entity key
public subjectEntityKey ( ) : string
return string

Property Details

$_defaultConfig protected_oe property

Default configuration
protected array $_defaultConfig
return array

$_responding protected_oe property

Check if the current action is responding to a request or not
protected bool $_responding
return boolean