public function productAction($product){
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository("MGraphicsSiteCoreBundle:Product")->findOneBySlug($product);
if(!$entity){
throw $this->createNotFoundException('Przepraszamy podana strona nie istnieje');
}
return $this->render(
'frontend/product/product.html.twig',
array('product' => $entity)
);
$this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS, $event);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = call_user_func_array($controller, $arguments);
// view
if (!$response instanceof Response) {
$event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
$this->dispatcher->dispatch(KernelEvents::VIEW, $event);
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$request->headers->set('X-Php-Ob-Level', ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$trustedProxies[] = '127.0.0.1';
Request::setTrustedProxies($trustedProxies, Request::HEADER_X_FORWARDED_ALL);
}
// always a "master" request (as the real master request can be in cache)
$response = $this->kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, $catch);
// FIXME: we probably need to also catch exceptions if raw === true
// we don't implement the stale-if-error on Requests, which is nonetheless part of the RFC
if (null !== $entry && in_array($response->getStatusCode(), array(500, 502, 503, 504))) {
if (null === $age = $entry->headers->getCacheControlDirective('stale-if-error')) {
reload the cache by fetching a fresh response and caching it (if possible).
*/
$this->record($request, 'reload');
$response = $this->fetch($request, $catch);
} else {
$response = $this->lookup($request, $catch);
}
$this->restoreResponseBody($request, $response);
if (HttpKernelInterface::MASTER_REQUEST === $type && $this->options['debug']) {
No log messages
NotFoundHttpException |
---|
Symfony\Component\HttpKernel\Exception\NotFoundHttpException: Przepraszamy podana strona nie istnieje at vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php:300 at Symfony\Bundle\FrameworkBundle\Controller\Controller->createNotFoundException('Przepraszamy podana strona nie istnieje') (src/MGraphics/Site/FrontendBundle/Controller/ProductController.php:22) at MGraphics\Site\FrontendBundle\Controller\ProductController->productAction('chevrolet-silverado-2012-139') at call_user_func_array(array(object(ProductController), 'productAction'), array('chevrolet-silverado-2012-139')) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:153) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:169) at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:465) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(object(Request), true, null) (vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php:57) at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward(object(Request), true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:419) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(object(Request), true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:316) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(object(Request), true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php:191) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(object(Request)) (public_html/app.php:15) |