PHPStorm 使用带注释的 Symfony 路由自动完成
PHPStorm autocomplete with Symfony routing with annotations
我正在使用最新版本的 PHPStorm 10 并想为我的 Symfony 2.8.1 路由使用注释。我想使用 PHPStorm 的自动完成功能来自动完成我在 twig 文件中的路线,但它们自动完成是错误的。我同时使用 Symfony2 插件和 PHP 注释。
路由文件
#app/config/routing.yml
ParkResortBundle:
resource: "@ParkResortBundle/Controller"
prefix: /
type: annotation
我的控制器有一条路线
namespace ParkResortBundle\Controller;
class DefaultController extends Controller
{
/**
* @return Response
* @Route("/")
*/
public function indexAction()
{
return $this->render('ParkResortBundle:Pages:firstpage.html.twig');
}
}
这通常会生成 park_resort_default_index
但它会生成 parkresort_default_index
并且我的 PHPStorm 会找到并使用下划线自动完成它。我还 运行 debug:router 进行了确认,它确实找到了路线,并且在没有下划线的情况下也能正常工作。但我想要它带有下划线。
sensio_blog_post_index
是 SensioBlogBundle 的 Postcontroller 索引操作的路由。它在驼峰式大写字母之间加了一个下划线。
我做错了什么?
我会添加你的案例。查看外部问题
https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/673
编辑:
已在“0.11.109”版本中修复
我正在使用最新版本的 PHPStorm 10 并想为我的 Symfony 2.8.1 路由使用注释。我想使用 PHPStorm 的自动完成功能来自动完成我在 twig 文件中的路线,但它们自动完成是错误的。我同时使用 Symfony2 插件和 PHP 注释。
路由文件
#app/config/routing.yml
ParkResortBundle:
resource: "@ParkResortBundle/Controller"
prefix: /
type: annotation
我的控制器有一条路线
namespace ParkResortBundle\Controller;
class DefaultController extends Controller
{
/**
* @return Response
* @Route("/")
*/
public function indexAction()
{
return $this->render('ParkResortBundle:Pages:firstpage.html.twig');
}
}
这通常会生成 park_resort_default_index
但它会生成 parkresort_default_index
并且我的 PHPStorm 会找到并使用下划线自动完成它。我还 运行 debug:router 进行了确认,它确实找到了路线,并且在没有下划线的情况下也能正常工作。但我想要它带有下划线。
sensio_blog_post_index
是 SensioBlogBundle 的 Postcontroller 索引操作的路由。它在驼峰式大写字母之间加了一个下划线。
我做错了什么?
我会添加你的案例。查看外部问题
https://github.com/Haehnchen/idea-php-symfony2-plugin/issues/673
编辑: 已在“0.11.109”版本中修复