PHP Class Contao\CoreBundle\EventListener\ToggleViewListener

Inheritance: use trait Contao\CoreBundle\Framework\ScopeAwareTrait
Show file Open project: contao/core-bundle Class Usage Examples

Public Methods

Method Description
__construct ( Contao\CoreBundle\Framework\ContaoFrameworkInterface $framework ) Constructor.
onKernelRequest ( GetResponseEvent $event ) Toggles the TL_VIEW cookie and redirects back to the referring page.

Private Methods

Method Description
getCookie ( string $value, string $basePath ) : Cookie Generates the TL_VIEW cookie based on the toggle_view value.

Method Details

__construct() public method

Constructor.
public __construct ( Contao\CoreBundle\Framework\ContaoFrameworkInterface $framework )
$framework Contao\CoreBundle\Framework\ContaoFrameworkInterface

onKernelRequest() public method

Toggles the TL_VIEW cookie and redirects back to the referring page.
public onKernelRequest ( GetResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseEvent