Method | Description | |
---|---|---|
addFlash ( string $type, string $message ) | Adds a flash message to the current session for type. | |
createAccessDeniedException ( string $message = 'Access Denied.', Exception $previous = null ) : Symfony\Component\Security\Core\Exception\AccessDeniedException | Returns an AccessDeniedException. | |
createForm ( string $type, mixed $data = null, array $options = [] ) : |
Creates and returns a Form instance from the type of the form. | |
createFormBuilder ( mixed $data = null, array $options = [] ) : |
Creates and returns a form builder instance. | |
createNotFoundException ( string $message = 'Not Found', Exception $previous = null ) : |
Returns a NotFoundHttpException. | |
denyAccessUnlessGranted ( mixed $attributes, mixed $object = null, string $message = 'Access Denied.' ) | Throws an exception unless the attributes are granted against the current authentication token and optionally supplied object. | |
file ( SplFileInfo | string $file, string | null $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT ) : |
Returns a BinaryFileResponse object with original or customized file name and disposition header. | |
forward ( string $controller, array $path = [], array $query = [] ) : |
Forwards the request to another controller. | |
generateUrl ( string $route, mixed $parameters = [], integer $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH ) : string | Generates a URL from the given parameters. | |
get ( string $id ) : object | Gets a container service by its id. | |
getDoctrine ( ) : Doctrine\Bundle\DoctrineBundle\Registry | Shortcut to return the Doctrine Registry service. | |
getParameter ( string $name ) : mixed | Gets a container configuration parameter by its name. | |
getUser ( ) : mixed | Get a user from the Security Token Storage. | |
has ( string $id ) : boolean | Returns true if the service id is defined. | |
isCsrfTokenValid ( string $id, string $token ) : boolean | Checks the validity of a CSRF token. | |
isGranted ( mixed $attributes, mixed $object = null ) : boolean | Checks if the attributes are granted against the current authentication token and optionally supplied object. | |
json ( mixed $data, integer $status = 200, array $headers = [], array $context = [] ) : Symfony\Component\HttpFoundation\JsonResponse | Returns a JsonResponse that uses the serializer component if enabled, or json_encode. | |
redirect ( string $url, integer $status = 302 ) : |
Returns a RedirectResponse to the given URL. | |
redirectToRoute ( string $route, array $parameters = [], integer $status = 302 ) : |
Returns a RedirectResponse to the given route with the given parameters. | |
render ( string $view, array $parameters = [], |
Renders a view. | |
renderView ( string $view, array $parameters = [] ) : string | Returns a rendered view. | |
stream ( string $view, array $parameters = [], Symfony\Component\HttpFoundation\StreamedResponse $response = null ) : Symfony\Component\HttpFoundation\StreamedResponse | Streams a view. |
protected createAccessDeniedException ( string $message = 'Access Denied.', Exception $previous = null ) : Symfony\Component\Security\Core\Exception\AccessDeniedException | ||
$message | string | A message |
$previous | Exception | The previous exception |
return | Symfony\Component\Security\Core\Exception\AccessDeniedException |
protected createFormBuilder ( mixed $data = null, array $options = [] ) : |
||
$data | mixed | The initial data for the form |
$options | array | Options for the form |
return |
protected createNotFoundException ( string $message = 'Not Found', Exception $previous = null ) : |
||
$message | string | A message |
$previous | Exception | The previous exception |
return |
protected file ( SplFileInfo | string $file, string | null $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT ) : |
||
$file | SplFileInfo | string | File object or path to file to be sent as response |
$fileName | string | null | File name to be sent to response or null (will use original file name) |
$disposition | string | Disposition of response ("attachment" is default, other type is "inline") |
return |
protected forward ( string $controller, array $path = [], array $query = [] ) : |
||
$controller | string | The controller name (a string like BlogBundle:Post:index) |
$path | array | An array of path parameters |
$query | array | An array of query parameters |
return | A Response instance |
protected generateUrl ( string $route, mixed $parameters = [], integer $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH ) : string | ||
$route | string | The name of the route |
$parameters | mixed | An array of parameters |
$referenceType | integer | The type of reference (one of the constants in UrlGeneratorInterface) |
return | string | The generated URL |
protected getDoctrine ( ) : Doctrine\Bundle\DoctrineBundle\Registry | ||
return | Doctrine\Bundle\DoctrineBundle\Registry |
protected getParameter ( string $name ) : mixed | ||
$name | string | The parameter name |
return | mixed |
protected json ( mixed $data, integer $status = 200, array $headers = [], array $context = [] ) : Symfony\Component\HttpFoundation\JsonResponse | ||
$data | mixed | The response data |
$status | integer | The status code to use for the Response |
$headers | array | Array of extra headers to add |
$context | array | Context to pass to serializer when using serializer component |
return | Symfony\Component\HttpFoundation\JsonResponse |
protected render ( string $view, array $parameters = [], |
||
$view | string | The view name |
$parameters | array | An array of parameters to pass to the view |
$response | A response instance | |
return | A Response instance |
protected stream ( string $view, array $parameters = [], Symfony\Component\HttpFoundation\StreamedResponse $response = null ) : Symfony\Component\HttpFoundation\StreamedResponse | ||
$view | string | The view name |
$parameters | array | An array of parameters to pass to the view |
$response | Symfony\Component\HttpFoundation\StreamedResponse | A response instance |
return | Symfony\Component\HttpFoundation\StreamedResponse | A StreamedResponse instance |