PHP Trait Crud\Traits\RedirectTrait

Datei anzeigen Open project: friendsofcake/crud

Public Methods

Method Description
redirectConfig ( null | string $name = null, null | array $config = null ) : mixed Change redirect configuration

Protected Methods

Method Description
_redirect ( Crud\Event\Subject $subject, string | array | null $url = null, integer | null $status = null ) : Response Called for all redirects inside CRUD
_redirectUrl ( string | null $default = null ) : mixed Returns the _redirect_url for this request.
_refererRedirectUrl ( string | null $default = null ) : mixed Returns the redirect_url for this request, with a fallback to the referring page

Method Details

_redirect() protected method

Called for all redirects inside CRUD
protected _redirect ( Crud\Event\Subject $subject, string | array | null $url = null, integer | null $status = null ) : Response
$subject Crud\Event\Subject Event subject
$url string | array | null URL
$status integer | null Status code
return Cake\Network\Response

_redirectUrl() protected method

Returns the _redirect_url for this request.
protected _redirectUrl ( string | null $default = null ) : mixed
$default string | null Default URL to use if _redirect_url if not found in request or data.
return mixed

_refererRedirectUrl() protected method

Returns the redirect_url for this request, with a fallback to the referring page
protected _refererRedirectUrl ( string | null $default = null ) : mixed
$default string | null Default URL to use redirect_url is not found in request or data
return mixed

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