use Symfony\Component\HttpKernel\Kernel; class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new AppBundle\AppBundle(), ); return $bundles; } }
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; $request = Request::createFromGlobals(); $kernel = new AppKernel('dev', true); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response);This example shows how to handle requests and responses using AppKernel. It creates a new instance of the AppKernel class and handles the request using the 'handle' method. Package Library: The package library associated with this example is Symfony.