简体   繁体   English

视觉工作室或Symfony原子:转到定义| 宣言

[英]visual studio or atom with Symfony : go to definition | declaration

I'm working with Symfony3 and I opened the project in my two best IDE visual studio code & atom but I don't find the behaviour that I expect to have which is go to declaration|defintion when maintaining CTRL + clicking for exemple here on "render" it must navigate to the render definition in the ControllerClass 我正在使用Symfony3,并用两个最佳的IDE Visual Studio代码原子打开了该项目,但是在维护CTRL +单击此处的示例时,找不到符合我定义的行为。 “渲染”,它必须导航到ControllerClass中的渲染定义

Default Controller: 默认控制器:

<?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

class DefaultController extends Controller
{
    /**
     * @Route("/", name="homepage")
     */
    public function indexAction(Request $request)
    {
        // replace this example code with whatever you need
        return $this->render('default/index.html.twig', [
            'base_dir' => realpath($this->getParameter('kernel.project_dir')).DIRECTORY_SEPARATOR,
        ]);
    }
}

I tried recommended plugin for atom but I find that it is an issue not resolved yet. 我尝试了推荐的原子插件,但我发现这是一个尚未解决的问题。

Can someone tell us what IDE to use and which plugin to install with Symfony knowing that this behavior is unavoidable for me. 有人可以告诉我们使用哪种IDE以及与Symfony一起安装哪个插件,因为我知道这种行为是不可避免的。

As I recall NetBeans has such functionality, but as I am testing it right now it sometimes work and sometimes not, can't say why cause for a long time I was using Atom. 我记得NetBeans具有这样的功能,但是当我现在对其进行测试时,它有时可以工作,有时不能,不能说出为什么我长时间使用Atom的原因。 Another option would be PHPStorm (first and only by most PROs I know). 另一个选择是PHPStorm(我认识的大多数PRO都是第一个,也是唯一一个)。

Personally i use PHPStorm, when i create new project, i just enable symfony plugin for the project and it handle well. 我个人使用PHPStorm,当我创建新项目时,我只为该项目启用symfony插件,并且处理得很好。 PS : the symfony plugin should be installed in PHPStorm PS:symfony插件应安装在PHPStorm中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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