Spork Code Libraries

Back

Allows controller to redirect to last route. Individual routes can be ignored or multiple routes can be blacklisted to prevent application from going back to those routes.

Extends
\Zend\Mvc\Controller\Plugin\AbstractPlugin
Implements

Constants

CONFIG_KEY

CONFIG_KEY

Properties

$ignore

$ignore : boolean

Flag to ignore current route

Type

boolean

$blacklist

$blacklist : array

List of routes to ignore

Type

array

$listeners

$listeners : array

List of listeners

Type

array

Methods

attach()

attach(\Zend\EventManager\EventManagerInterface  $events) 

Attach listeners

Parameters

\Zend\EventManager\EventManagerInterface $events
See also

detach()

detach(\Zend\EventManager\EventManagerInterface  $events) 

Detach listeners

Parameters

\Zend\EventManager\EventManagerInterface $events
See also

getBlacklist()

getBlacklist() : \Spork\Mvc\Controller\Plugin\array:

Get list of blacklist routes

Returns

\Spork\Mvc\Controller\Plugin\array:

setBlacklist()

setBlacklist(array  $blacklist) 

Set list of blacklist routes

Parameters

array $blacklist

ignore()

ignore(string  $flag = true) 

Ignore matched route to prevent plugin from returning to this page

Parameters

string $flag

redirect()

redirect(string  $default = 'home') 

Redirect to last route

Parameters

string $default

Default route to use if previous route not found

url()

url(string  $default = 'home') 

Get last route URL

Parameters

string $default

injectPlugin()

injectPlugin(\Zend\Mvc\MvcEvent  $event) 

Inject instance into controller plugin manager.

This ensures controller plugin is same instance as event listener.

Parameters

\Zend\Mvc\MvcEvent $event

storeRoute()

storeRoute(\Zend\Mvc\MvcEvent  $event) 

Store route in session so it can be returned to later.

Parameters

\Zend\Mvc\MvcEvent $event

getSession()

getSession() : \Zend\Session\Container

Get session

Returns

\Zend\Session\Container