What is a "weak route" in Symfony 2?

When using the Symfony2 plugin for PHPStorm, I sometimes see a Weak Route warning: Weak route

What does it mean?

8673 次浏览

Worked it out. The Symfony2 plugin parses the appDevDebugProjectContainer.php file to get route and service information. However this file is only recompiled when the web page is loaded which means newly created routes are not included.

To get around this the plugin also parses the config files but this is not 100% reliable so routes discovered in this way are marked as "weak". Reloading the web page will make the warning go away.

I also get the same problem and in my case, because i use '/' to declare the render template instead of ":" Changing from "/" to ":" cleared that warning in my case

Check path to file urlGenerator

For me right path is:

var/cache/dev/appDevDebugProjectContainerUrlGenerator.php

And after make click to button "Clear Index" above

enter image description here

I finally fixed this issue for my situation (Symfony 2.8 / PhpStorm 2016.3).

It's similar to @Atmarama 's solution but I think my version of PhpStorm (2016.3) is different and/or Symfony 2.8.

My solution also doesn't involve the deprecated setting. I hope this will help others:

In PhpStorm go to Languages & Frameworks > PHP > Symfony > Routing and add the path to appDevProjectContainerUrlGenerator.php.

In my case this is:

var/cache/dev/appDevDebugProjectContainerUrlGenerator.php

PhpStorm 2016.3 settings to fix weak route issue