php NetBeans 的 Smarty 插件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1551693/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Smarty plugin for NetBeans
提问by AndreyAkinshin
I am looking plugin for work with Smarty in NetBeans.
我正在寻找在 NetBeans 中使用 Smarty 的插件。
I need coloring of my code and normal syntax analysys.
我需要着色我的代码和正常的语法分析。
I could find only this plugin: Smarty Editor, but I could not make it work.
我只能找到这个插件:Smarty Editor,但我无法让它工作。
Can you tell me about another plugin for Smarty or teach me how to install SmartyEditor?
你能告诉我 Smarty 的另一个插件或教我如何安装 SmartyEditor 吗?
Edit:I use Windows XP SP3
编辑:我使用 Windows XP SP3
回答by ownking
Hi you can intall the PHP Smarty Framework Plugin just by using the Netbeans plugin manager:
嗨,您可以使用 Netbeans 插件管理器来安装 PHP Smarty 框架插件:
Tools -> Plugins -> Available Plugins -> Serach for "Smarty" -> Insall
工具 -> 插件 -> 可用插件 -> 搜索“Smarty” -> Insall
This runs directly without restarting your IDE.
这会直接运行而无需重新启动您的 IDE。
(I'm using NB 6.9.1)
(我使用的是 NB 6.9.1)
回答by fvu
It worked for me, out of the box. I use NetBeans 6.7.1 and this is what I did
它对我有用,开箱即用。我使用 NetBeans 6.7.1,这就是我所做的
- Downloaded the plugin .nbm file from the location you mentioned
- Install plugin as explained here
- In an existing project with web stuff, File-->New File-->Other-->Empty Smarty file
This generated at .tpl file with just
这仅在 .tpl 文件中生成
{*
Author:
Smarty template
*}
in it. As explained on the plugin download page, outside the Smarty tags you get only basic functionality in as well php as html segments of the file, but as far as I can see the syntax coloring of php and html is OK. Code completion works fine inside Smarty tags.
在里面。正如插件下载页面上所解释的,在 Smarty 标签之外,您只能获得 php 和文件 html 段中的基本功能,但据我所知,php 和 html 的语法着色是可以的。代码完成在 Smarty 标签内工作正常。
Regarding syntax analysis: I created a number of errors is html and php in the tpl file and it seems to pick them up correctly.
关于语法分析:我在 tpl 文件中创建了一些错误是 html 和 php,它似乎正确地选择了它们。
So, while it's annoying that you loose code completion in html and php it looks quite usable and useful to me.
因此,虽然在 html 和 php 中丢失代码完成很烦人,但它对我来说看起来非常有用和有用。
Let me know if these instructions solved your problem.
如果这些说明解决了您的问题,请告诉我。
回答by rlorenzo
Just found this post from Google and saw that the information is now outdated.
刚从谷歌上找到这个帖子,看到信息现在已经过时了。
In the most recent builds of NetBeans, there is now official support for Smarty: http://blogs.oracle.com/netbeansphp/entry/initial_support_for_smarty_available
在 NetBeans 的最新版本中,现在官方支持 Smarty:http: //blogs.oracle.com/netbeansphp/entry/initial_support_for_smarty_available
Just download the development versions of NetBeans. Then go to tools > plugins and search for the "PHP Smarty Framework" plugin and install it.
只需下载 NetBeans 的开发版本。然后转到工具>插件并搜索“PHP Smarty Framework”插件并安装它。
回答by self
In Netbeans 6.9.1 plugin available but works only syntax highlight and html-tag completion. Smarty tags doesn't work.
在 Netbeans 6.9.1 插件中可用,但仅适用于语法高亮和 html-tag 完成。Smarty 标签不起作用。
回答by streetparade
Hello What you have todo is to first install the smarty editor plugin then edit this file on vista : C:\Users\yourusername.netbeans\6.7\config\Services\MIMEResolver\user-defined-mime-resolver.xml
您好您要做的是首先安装 smarty 编辑器插件,然后在 vista 上编辑此文件: C:\Users\yourusername.netbeans\6.7\config\Services\MIMEResolver\user-defined-mime-resolver.xml
Delete everything and add the following code to the file :
删除所有内容并将以下代码添加到文件中:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MIME-resolver PUBLIC "-//NetBeans//DTD MIME Resolver 1.1//EN" "http://www.netbeans.org/dtds/mime-resolver-1_1.dtd">
<MIME-resolver>
<file>
<ext name="tpl"/>
<resolver mime="text/x-tpl"/>
</file>
</MIME-resolver>
回答by Martin Fousek
Basic code completion for Smarty templates will be available in NetBeans 7.0. I'm afraid that the rest code completion will have to wait till will be implemented some indented for automatic code formating which seems to be more required feature by users.
NetBeans 7.0 中将提供 Smarty 模板的基本代码完成功能。恐怕其余的代码完成将不得不等到将实现一些缩进以进行自动代码格式化,这似乎是用户更需要的功能。
回答by Steve
No longer listed in available plugins nor available natively (I'm using 7.0.1), looks like this is the plugin to use, executing the file installed it fine for me: http://plugins.netbeans.org/plugin/37379/php-smarty
不再在可用插件中列出,也不再本地可用(我使用的是 7.0.1),看起来这是要使用的插件,执行安装的文件对我来说很好:http: //plugins.netbeans.org/plugin/37379 /php-聪明

