What is a "weak route" in Symfony 2?
SymfonyPhpstormSymfony Problem Overview
When using the Symfony2 plugin for PHPStorm, I sometimes see a Weak Route warning:
What does it mean?
Symfony Solutions
Solution 1 - Symfony
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.
Solution 2 - Symfony
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
Solution 3 - Symfony
Check path to file urlGenerator
For me right path is:
var/cache/dev/appDevDebugProjectContainerUrlGenerator.php
And after make click to button "Clear Index" above
Solution 4 - Symfony
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