PHP Class Symfony\Bundle\FrameworkBundle\HttpKernel

Author: Fabien Potencier ([email protected])
Author: Johannes M. Schmitt ([email protected])
Inheritance: extends Symfony\Component\HttpKernel\HttpKernel
显示文件 Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
__construct ( Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher, Symfony\Component\DependencyInjection\ContainerInterface $container, Symfony\Component\HttpKernel\Controller\ControllerResolverInterface $controllerResolver )
forward ( string $controller, array $attributes = [], array $query = [] ) : Response Forwards the request to another controller.
generateInternalUri ( string $controller, array $attributes = [], array $query = [] ) : string Generates an internal URI for a given controller.
handle ( Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true )
render ( string $controller, array $options = [] ) : string Renders a Controller and returns the Response content.

Method Details

__construct() public method

public __construct ( Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher, Symfony\Component\DependencyInjection\ContainerInterface $container, Symfony\Component\HttpKernel\Controller\ControllerResolverInterface $controllerResolver )
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$container Symfony\Component\DependencyInjection\ContainerInterface
$controllerResolver Symfony\Component\HttpKernel\Controller\ControllerResolverInterface

forward() public method

Forwards the request to another controller.
public forward ( string $controller, array $attributes = [], array $query = [] ) : Response
$controller string The controller name (a string like BlogBundle:Post:index)
$attributes array An array of request attributes
$query array An array of request query parameters
return Response A Response instance

generateInternalUri() public method

This method uses the "_internal" route, which should be available.
public generateInternalUri ( string $controller, array $attributes = [], array $query = [] ) : string
$controller string A controller name to execute (a string like BlogBundle:Post:index), or a relative URI
$attributes array An array of request attributes
$query array An array of request query parameters
return string An internal URI

handle() public method

public handle ( Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true )
$request Symfony\Component\HttpFoundation\Request

render() public method

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: * attributes: An array of request attributes (only when the first argument is a controller) * query: An array of request query parameters (only when the first argument is a controller) * ignore_errors: true to return an empty string in case of an error * alt: an alternative controller to execute in case of an error (can be a controller, a URI, or an array with the controller, the attributes, and the query arguments) * 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
public render ( string $controller, array $options = [] ) : string
$controller string A controller name to execute (a string like BlogBundle:Post:index), or a relative URI
$options array An array of options
return string The Response content