| setContainer(ContainerInterface $container = null) | from ContainerAwareTrait |
bool | has(string $id) Returns true if the service id is defined. | from ControllerTrait |
object | get(string $id) Gets a container service by its id. | from ControllerTrait |
string | generateUrl(string $route, array $parameters = array(), int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) Generates a URL from the given parameters. | from ControllerTrait |
Response | forward(string $controller, array $path = array(), array $query = array()) Forwards the request to another controller. | from ControllerTrait |
RedirectResponse | redirect(string $url, int $status = 302) Returns a RedirectResponse to the given URL. | from ControllerTrait |
RedirectResponse | redirectToRoute(string $route, array $parameters = array(), int $status = 302) Returns a RedirectResponse to the given route with the given parameters. | from ControllerTrait |
JsonResponse | json($data, int $status = 200, array $headers = array(), array $context = array()) Returns a JsonResponse that uses the serializer component if enabled, or json_encode. | from ControllerTrait |
BinaryFileResponse | file($file, string $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT) Returns a BinaryFileResponse object with original or customized file name and disposition header. | from ControllerTrait |
| addFlash(string $type, string $message) Adds a flash message to the current session for type. | from ControllerTrait |
bool | isGranted($attributes, $subject = null) Checks if the attributes are granted against the current authentication token and optionally supplied subject. | from ControllerTrait |
| denyAccessUnlessGranted($attributes, $subject = null, string $message = 'Access Denied.') Throws an exception unless the attributes are granted against the current authentication token and optionally supplied subject. | from ControllerTrait |
string | renderView(string $view, array $parameters = array()) Returns a rendered view. | from ControllerTrait |
Response | render(string $view, array $parameters = array(), Response $response = null) Renders a view. | from ControllerTrait |
StreamedResponse | stream(string $view, array $parameters = array(), StreamedResponse $response = null) Streams a view. | from ControllerTrait |
NotFoundHttpException | createNotFoundException(string $message = 'Not Found', Exception $previous = null) Returns a NotFoundHttpException. | from ControllerTrait |
AccessDeniedException | createAccessDeniedException(string $message = 'Access Denied.', Exception $previous = null) Returns an AccessDeniedException. | from ControllerTrait |
FormInterface | createForm(string $type, $data = null, array $options = array()) Creates and returns a Form instance from the type of the form. | from ControllerTrait |
FormBuilderInterface | createFormBuilder($data = null, array $options = array()) Creates and returns a form builder instance. | from ControllerTrait |
ManagerRegistry | getDoctrine() Shortcut to return the Doctrine Registry service. | from ControllerTrait |
mixed | getUser() Get a user from the Security Token Storage. | from ControllerTrait |
bool | isCsrfTokenValid(string $id, string|null $token) Checks the validity of a CSRF token. | from ControllerTrait |
| dispatchMessage(object $message) Dispatches a message to the bus. | from ControllerTrait |
mixed | getParameter(string $name) Gets a container configuration parameter by its name. | |
Parameters
protected bool
has(string $id)
Returns true if the service id is defined.
Parameters
Return Value
protected object
get(string $id)
Gets a container service by its id.
Parameters
Return Value
protected string
generateUrl(string $route, array $parameters = array(), int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
Generates a URL from the given parameters.
Parameters
string | $route | |
array | $parameters | |
int | $referenceType | |
Return Value
See also
protected Response
forward(string $controller, array $path = array(), array $query = array())
Forwards the request to another controller.
Parameters
string | $controller | |
array | $path | |
array | $query | |
Return Value
protected RedirectResponse
redirect(string $url, int $status = 302)
Returns a RedirectResponse to the given URL.
Parameters
Return Value
protected RedirectResponse
redirectToRoute(string $route, array $parameters = array(), int $status = 302)
Returns a RedirectResponse to the given route with the given parameters.
Parameters
string | $route | |
array | $parameters | |
int | $status | |
Return Value
protected JsonResponse
json($data, int $status = 200, array $headers = array(), array $context = array())
Returns a JsonResponse that uses the serializer component if enabled, or json_encode.
Parameters
| $data | |
int | $status | |
array | $headers | |
array | $context | |
Return Value
protected BinaryFileResponse
file($file, string $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT)
Returns a BinaryFileResponse object with original or customized file name and disposition header.
Parameters
| $file | |
string | $fileName | |
string | $disposition | |
Return Value
protected
addFlash(string $type, string $message)
Adds a flash message to the current session for type.
Parameters
string | $type | |
string | $message | |
Exceptions
protected bool
isGranted($attributes, $subject = null)
Checks if the attributes are granted against the current authentication token and optionally supplied subject.
Parameters
Return Value
Exceptions
protected
denyAccessUnlessGranted($attributes, $subject = null, string $message = 'Access Denied.')
Throws an exception unless the attributes are granted against the current authentication token and optionally supplied subject.
Parameters
| $attributes | |
| $subject | |
string | $message | |
Exceptions
protected string
renderView(string $view, array $parameters = array())
Returns a rendered view.
Parameters
string | $view | |
array | $parameters | |
Return Value
protected Response
render(string $view, array $parameters = array(), Response $response = null)
Renders a view.
Parameters
string | $view | |
array | $parameters | |
Response | $response | |
Return Value
protected StreamedResponse
stream(string $view, array $parameters = array(), StreamedResponse $response = null)
Streams a view.
Parameters
Return Value
protected NotFoundHttpException
createNotFoundException(string $message = 'Not Found', Exception $previous = null)
Returns a NotFoundHttpException.
This will result in a 404 response code. Usage example:
throw $this->createNotFoundException('Page not found!');
Parameters
Return Value
protected AccessDeniedException
createAccessDeniedException(string $message = 'Access Denied.', Exception $previous = null)
Returns an AccessDeniedException.
This will result in a 403 response code. Usage example:
throw $this->createAccessDeniedException('Unable to access this page!');
Parameters
Return Value
Exceptions
Creates and returns a Form instance from the type of the form.
Parameters
string | $type | |
| $data | |
array | $options | |
Return Value
Creates and returns a form builder instance.
Parameters
Return Value
protected ManagerRegistry
getDoctrine()
Shortcut to return the Doctrine Registry service.
Return Value
Exceptions
protected mixed
getUser()
Get a user from the Security Token Storage.
Return Value
Exceptions
See also
TokenInterface::getUser() | |
protected bool
isCsrfTokenValid(string $id, string|null $token)
Checks the validity of a CSRF token.
Parameters
string | $id | The id used when generating the token |
string|null | $token | The actual token sent with the request that should be validated |
Return Value
protected
dispatchMessage(object $message)
Dispatches a message to the bus.
Parameters
object | $message | The message to dispatch |
protected mixed
getParameter(string $name)
Gets a container configuration parameter by its name.
Parameters
Return Value