}
} while (false !== $locale = strstr($locale, '_', true));
}
if (!isset($this->compiledRoutes[$name])) {
throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', $name));
}
[$variables, $defaults, $requirements, $tokens, $hostTokens, $requiredSchemes] = $this->compiledRoutes[$name];
if (isset($defaults['_canonical_route']) && isset($defaults['_locale'])) {
public function newsByYearAction($year)
{
$date = getdate();
if ($year < 2009) {
return $this->redirectToRoute('troika_year_news', ['year' => 2009], 301);
} elseif ($year > $date['year']) {
return $this->redirectToRoute('troika_year_news', ['year' => $date['year']], 301);
}
$page = $_GET['page'] ?? 1;
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
// 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();
try {
$response = $kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, true); //$dev
} catch (Exception $e) {
if ($dev) {
if (property_exists($e, 'xdebug_message')) {
$message = $e->xdebug_message;
} else {
Level | Channel | Message |
---|---|---|
CRITICAL 18:31:32 | request |
Uncaught PHP Exception Symfony\Component\Routing\Exception\RouteNotFoundException: "Unable to generate a URL for the named route "troika_year_news" as such route does not exist." at /home/troikaestate/public_html/vendor/symfony/routing/Generator/CompiledUrlGenerator.php line 50
{ "exception": { "xdebug_message": "<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Symfony\\Component\\Routing\\Exception\\RouteNotFoundException: Unable to generate a URL for the named route \"troika_year_news\" as such route does not exist. in /home/troikaestate/public_html/vendor/symfony/routing/Generator/CompiledUrlGenerator.php on line <i>50</i></th></tr>\n<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>\n<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>\n<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0004</td><td bgcolor='#eeeeec' align='right'>360048</td><td bgcolor='#eeeeec'>{main}( )</td><td title='/home/troikaestate/public_html/web/app.php' bgcolor='#eeeeec'>.../app.php<b>:</b>0</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0079</td><td bgcolor='#eeeeec' align='right'>406448</td><td bgcolor='#eeeeec'>Symfony\\Component\\HttpKernel\\Kernel->handle( <span>$request = </span><span>class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = [...] }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = [...] }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = [...]; protected $cacheControl = [...] }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = '/news/-184'; protected $requestUri = '/news/-184'; protected $baseUrl = ''; protected $basePath = NULL; protected $method = 'GET'; protected $format = NULL; protected $session = class Closure { virtual $closure = "$this->Symfony\\Component\\HttpKernel\\EventListener\\{closure}" }; protected $locale = NULL; protected $defaultLocale = 'ru'; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }</span>, <span>$type = </span><span>1</span>, <span>$catch = </span><span>TRUE</span> )</td><td title='/home/troikaestate/public_html/web/app.php' bgcolor='#eeeeec'>.../app.php<b>:</b>52</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.0894</td><td bgcolor='#eeeeec' align='right'>1099848</td><td bgcolor='#eeeeec'>Symfony\\Component\\HttpKernel\\HttpKernel->handle( <span>$request = </span><span>class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = [...] }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = [...] }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = [...]; protected $cacheControl = [...] }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = '/news/-184'; protected $requestUri = '/news/-184'; protected $baseUrl = ''; protected $basePath = NULL; protected $method = 'GET'; protected $format = NULL; protected $session = class Closure { virtual $closure = "$this->Symfony\\Component\\HttpKernel\\EventListener\\{closure}" }; protected $locale = NULL; protected $defaultLocale = 'ru'; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }</span>, <span>$type = </span><span>1</span>, <span>$catch = </span><span>TRUE</span> )</td><td title='/home/troikaestate/public_html/vendor/symfony/http-kernel/Kernel.php' bgcolor='#eeeeec'>.../Kernel.php<b>:</b>201</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.0894</td><td bgcolor='#eeeeec' align='right'>1100640</td><td bgcolor='#eeeeec'>Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw( <span>$request = </span><span>class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = [...] }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = [...] }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = [...]; protected $cacheControl = [...] }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = '/news/-184'; protected $requestUri = '/news/-184'; protected $baseUrl = ''; protected $basePath = NULL; protected $method = 'GET'; protected $format = NULL; protected $session = class Closure { virtual $closure = "$this->Symfony\\Component\\HttpKernel\\EventListener\\{closure}" }; protected $locale = NULL; protected $defaultLocale = 'ru'; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }</span>, <span>$type = </span><span>1</span> )</td><td title='/home/troikaestate/public_html/vendor/symfony/http-kernel/HttpKernel.php' bgcolor='#eeeeec'>.../HttpKernel.php<b>:</b>81</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.1217</td><td bgcolor='#eeeeec' align='right'>1683200</td><td bgcolor='#eeeeec'>Troika\\RealEstateBundle\\Controller\\DefaultController->newsByYearAction( <span>$year = </span><span>'-184'</span> )</td><td title='/home/troikaestate/public_html/vendor/symfony/http-kernel/HttpKernel.php' bgcolor='#eeeeec'>.../HttpKernel.php<b>:</b>169</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.1217</td><td bgcolor='#eeeeec' align='right'>1684288</td><td bgcolor='#eeeeec'>Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController->redirectToRoute( <span>$route = </span><span>'troika_year_news'</span>, <span>$parameters = </span><span>['year' => 2009]</span>, <span>$status = </span><span>301</span> )</td><td title='/home/troikaestate/public_html/src/Troika/RealEstateBundle/Controller/DefaultController.php' bgcolor='#eeeeec'>.../DefaultController.php<b>:</b>415</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.1217</td><td bgcolor='#eeeeec' align='right'>1684288</td><td bgcolor='#eeeeec'>Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController->generateUrl( <span>$route = </span><span>'troika_year_news'</span>, <span>$parameters = </span><span>['year' => 2009]</span>, <span>$referenceType = </span>??? )</td><td title='/home/troikaestate/public_html/vendor/symfony/framework-bundle/Controller/ControllerTrait.php' bgcolor='#eeeeec'>.../ControllerTrait.php<b>:</b>116</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>8</td><td bgcolor='#eeeeec' align='center'>0.1218</td><td bgcolor='#eeeeec' align='right'>1684288</td><td bgcolor='#eeeeec'>Symfony\\Component\\Routing\\Router->generate( <span>$name = </span><span>'troika_year_news'</span>, <span>$parameters = </span><span>['year' => 2009]</span>, <span>$referenceType = </span><span>1</span> )</td><td title='/home/troikaestate/public_html/vendor/symfony/framework-bundle/Controller/ControllerTrait.php' bgcolor='#eeeeec'>.../ControllerTrait.php<b>:</b>80</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>9</td><td bgcolor='#eeeeec' align='center'>0.1316</td><td bgcolor='#eeeeec' align='right'>1688304</td><td bgcolor='#eeeeec'>Symfony\\Component\\Routing\\Generator\\CompiledUrlGenerator->generate( <span>$name = </span><span>'troika_year_news'</span>, <span>$parameters = </span><span>['year' => 2009]</span>, <span>$referenceType = </span><span>1</span> )</td><td title='/home/troikaestate/public_html/vendor/symfony/routing/Router.php' bgcolor='#eeeeec'>.../Router.php<b>:</b>252</td></tr>\n" } } |
RouteNotFoundException |
---|
Symfony\Component\Routing\Exception\RouteNotFoundException: Unable to generate a URL for the named route "troika_year_news" as such route does not exist. at vendor/symfony/routing/Generator/CompiledUrlGenerator.php:50 at Symfony\Component\Routing\Generator\CompiledUrlGenerator->generate() (vendor/symfony/routing/Router.php:252) at Symfony\Component\Routing\Router->generate() (vendor/symfony/framework-bundle/Controller/ControllerTrait.php:80) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->generateUrl() (vendor/symfony/framework-bundle/Controller/ControllerTrait.php:116) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->redirectToRoute() (src/Troika/RealEstateBundle/Controller/DefaultController.php:415) at Troika\RealEstateBundle\Controller\DefaultController->newsByYearAction() (vendor/symfony/http-kernel/HttpKernel.php:169) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:81) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:201) at Symfony\Component\HttpKernel\Kernel->handle() (web/app.php:52) |