Skip to main content

Interacting with the request

The Page class within PhotonCoreBundle initialises the Symfony Request object in its constructor.

The Request stack object can be retrieved in classes that extend Page by calling getRequestStack() method.

Further details on how to interact with data held in the Request object are provided in the Symfony documentation - Accessing Request Data.

<?php

if (
$this->getRequestStack()->request->has('period')
&& $this->getRequestStack()->request->get('period') == 'today'
) {
// ...
}