Idea-php-symfony2-plugin: Missing support for route name_prefix

Created on 5 Mar 2019  路  13Comments  路  Source: Haehnchen/idea-php-symfony2-plugin

See: https://symfony.com/blog/new-in-symfony-4-1-prefix-imported-route-names

Example

The following configuration defines a single route named admin.dashboard. Referencing the route name triggers "Route Missing" inspections as the plugin thinks that the route name is dashboard.

# config/routes.yaml
admin:
    resource: routes/admin.yaml
    prefix: /admin
    trailing_slash_on_root: false
    name_prefix: admin.
# config/routes/admin/yaml
dashboard:
    path: /
    controller: App\Admin\Web\DashboardAction
    methods: [GET]

Most helpful comment

With release 0.19.190 you can add the var/cache/dev/UrlGenerator.php in Settings > Languagues & Frameworks > PHP > Symfony > Routing which solves the problem.

Thank you very much @Haehnchen

All 13 comments

Also ran into that issue today on a new project. Is there any way to help without knowing java?

+1

+1

+1

+1

+1

there is a temp workaround?

+1

With release 0.19.190 you can add the var/cache/dev/UrlGenerator.php in Settings > Languagues & Frameworks > PHP > Symfony > Routing which solves the problem.

Thank you very much @Haehnchen

Yes, from 0.19.190 version, it works!

With Symfony 5, UrlGenerator.php no longer exists (I think Nicolas Grekas made a HUGE optimization with the routing). Now there are url_generating_routes.php and url_matching_routes.php

yes the new format was added via: https://github.com/Haehnchen/idea-php-symfony2-plugin/commit/71b03398eee1906f7737aea2e4d03eaec45b1c6f thats why the routes are working now and also autodetection of this was was improved.

so UrlGenerator or url_generating_routescan be taken if its not used by its own.

for me it still can be approved to also load config eg via config/routes.yaml to not relay on this routing file, but i guess most common usages would now work.

It works so well! Thank you guys :D

Was this page helpful?
0 / 5 - 0 ratings