Symfony2 API
Class

Symfony\Bundle\FrameworkBundle\HttpKernel

class HttpKernel extends ContainerAwareHttpKernel

This HttpKernel is used to manage scope changes of the DI container.

Methods

__construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver)

Constructor

from ContainerAwareHttpKernel
Response handle(Request $request, integer $type = HttpKernelInterface::MASTER_REQUEST, Boolean $catch = true)

Handles a Request to convert it to a Response.

from ContainerAwareHttpKernel
Response forward(string $controller, array $attributes = array(), array $query = array())

Forwards the request to another controller.

string render(string $uri, array $options = array())

Renders a Controller and returns the Response content.

Details

public __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver)

Constructor

Parameters

EventDispatcherInterface $dispatcher An EventDispatcherInterface instance
ContainerInterface $container A ContainerInterface instance
ControllerResolverInterface $controllerResolver A ControllerResolverInterface instance

public Response handle(Request $request, integer $type = HttpKernelInterface::MASTER_REQUEST, Boolean $catch = true)

Handles a Request to convert it to a Response.

When $catch is true, the implementation must catch all exceptions
and do its best to convert them to a Response instance.

Parameters

Request $request A Request instance
integer $type The type of the request (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)
Boolean $catch Whether to catch exceptions or not

Return Value

Response A Response instance

Exceptions

Exception When an Exception occurs during processing

at line 39
public Response forward(string $controller, array $attributes = array(), array $query = array())

Forwards the request to another controller.

Parameters

string $controller The controller name (a string like BlogBundle:Post:index)
array $attributes An array of request attributes
array $query An array of request query parameters

Return Value

Response A Response instance

at line 72
public string render(string $uri, array $options = array())

Renders a Controller and returns the Response content.

Note that this method generates an esi:include tag only when both the standalone
option is set to true and the request has ESI capability (see Symfony\Component\HttpKernel\HttpCache\ESI).

Available options:

* ignore_errors: true to return an empty string in case of an error
* alt: an alternative URI to execute in case of an error
* standalone: whether to generate an esi:include tag or not when ESI is supported
* comment: a comment to add when returning an esi:include tag

Parameters

string $uri A URI
array $options An array of options

Return Value

string The Response content

Exceptions

RuntimeException
Exception