简体   繁体   English

如何确定Netbeans 7.3和Symfony2是否正常工作?

[英]How can I tell if Netbeans 7.3 and Symfony2 is working properly?

I have recently followed the common advice found on the internet on how to install Symfony2 in Netbeans 7.3 by pointing the configuration to the Symfony2 standard edition zip file. 最近,我通过将配置指向Symfony2标准版zip文件,遵循了Internet上关于如何在Netbeans 7.3中安装Symfony2的常见建议。

Now I'm following the book on the Symfony website to create the HelloBundle demo, and I'm noticing some inconsistencies. 现在,我在Symfony网站上关注该书,以创建HelloBundle演示,并且注意到一些不一致之处。

First, when running a Symfony command in Netbeans, the generate bundle does not work as the book says it should . 首先,在Netbeans中运行Symfony命令时,generate bundle不能按所述正常工作。 It forces me to use the --dir option. 它迫使我使用--dir选项。 Here are the parameters I had to add: 这是我必须添加的参数:

--namespace=Acme/HelloBundle --format=yml  --dir=src

Secondly, I see the routing file that was created, but the route parameters are different than what the book says. 其次,我看到已创建的路由文件,但是路由参数与本书所说的不同。 First the term "Pattern" is used instead of "Path." 首先,使用术语“模式”代替“路径”。 Further searching indicates that "Pattern" is an obsolete term and that "Path" is preferred now. 进一步的搜索表明“模式”是一个过时的术语,并且“路径”现在是首选。 If this is the case, then why is "Pattern" showing up in my files if I'm using the most current version of the framework (2.3.1)? 如果是这种情况,那么如果我使用的是最新版本的框架(2.3.1),为什么在我的文件中显示“模式”? Also, my routing file has the word "Default" in it while the book has "Hello." 另外,我的路由文件中包含单词“ Default”,而书中包含“ Hello”。 Here is a copy of the output. 这是输出的副本。

acme_hello_homepage:
    pattern:  /hello/{name}
    defaults: { _controller: AcmeHelloBundle:Default:index }

Finally, the book is unclear as to whether or not creating the bundle also automatically creates the controller files. 最后,关于创建捆绑软件是否还会自动创建控制器文件尚不清楚。 Is this the case? 是这样吗 I do not have "HelloController.php" file the books says I should be editing. 书中没有显示我应编辑的“ HelloController.php”文件。

I'm new to Symfony, but this feels a little off. 我是Symfony的新手,但是感觉有点不对劲。 If that's the case how do I configure it to work as it should? 如果是这种情况,我如何配置它以使其正常工作?

I'm using Netbeans as IDE for my symfony 2.x projects, i can't tell what's the problem with your Netbeans configuration, but here's a guide that can help setting-up things :) 我正在将Netbeans用作我的symfony 2.x项目的IDE,我无法确定您的Netbeans配置有什么问题,但是这里有一个指南,可以帮助您进行设置:)

http://software-talk.org/blog/2012/06/symfony2-tutorial-netbeans-and-symfony2-setting-everything-up/ http://software-talk.org/blog/2012/06/symfony2-tutorial-netbeans-and-symfony2-setting-everything-up/

Hope it helps. 希望能帮助到你。

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

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