简体   繁体   中英

PHPStorm autocomplete with Symfony routing with annotations

I'm using latest version of PHPStorm 10 and want to use annotations for my Symfony 2.8.1 routes. I want to use PHPStorm's autocomplete feature to autocomplete my routes in twig files, but they are autocompleted wrong. I'm using both Symfony2 plugin and PHP Annotations.

Routing file

#app/config/routing.yml
ParkResortBundle:
    resource: "@ParkResortBundle/Controller"
    prefix: /
    type: annotation

My controller with one route

namespace ParkResortBundle\Controller;
class DefaultController extends Controller
{
    /**
     * @return Response
     * @Route("/")
     */
    public function indexAction()
    {
        return $this->render('ParkResortBundle:Pages:firstpage.html.twig');
    }
}

This should normally generate park_resort_default_index but instead it generates parkresort_default_index and my PHPStorm finds and autocompletes it with the underscore. I've also ran debug:router to confirm and it indeed finds the route and it does work without the underscore. But I want it with the underscore.

Even in the docs it says :

sensio_blog_post_index is the route for SensioBlogBundle's Postcontroller index action. It puts an underscore in between the camelcase capital letters.

What did I do wrong?

I will add your cases. see external issues

https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/673

EDIT: fixed in version "0.11.109"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM