$this->view_data['noti'] = $noti = $this->session->get('noti') ? $this->session->get('noti') : null;//Thông báo
$this->session->remove('noti');
//DETAIL
$news = new NewsComponent($this->container, $request);
$this->view_data['news'] = $news->Index($category, $code, $request->getUri());
$this->view_data['category'] = $category;
$this->view_data['code'] = $code;
$this->view_data['_route'] = $request->get('_route');
return $this->render('WebBundle:News:detail.html.twig', $this->view_data);
$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) {
//$kernel = new AppCache($kernel);
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
//Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
No log messages
FatalThrowableError |
---|
Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function getNews() on null at src/AppBundle/Component/NewsComponent.php:27 at AppBundle\Component\NewsComponent->Index('tu-van', 'huong-dan-tinh-gia-phan-tho-trong-xay-dung_22', 'http://nhtcorp.com/bai-viet/tu-van/huong-dan-tinh-gia-phan-tho-trong-xay-dung_22') (src/WebBundle/Controller/NewsController.php:46) at WebBundle\Controller\NewsController->detailAction(object(Request), 'tu-van', 'huong-dan-tinh-gia-phan-tho-trong-xay-dung_22') (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151) 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:200) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (web/app.php:20) |