因较喜欢开源的eclipse,以前用来写java很顺手,最近对php的支持也不错,就使用了,但现在有个小bug在里面,导致Smarty不能高亮显示语法,不得以转向了Zend studio,不过也是基于eclipse的,这让我欣喜若狂,在Smarty上可以高亮显示,有时候真不知道怎么了,为了一个语法高亮居然转了平台,不过这个对写程序帮助很大啊,幸亏两个差别不大,下面贴出过程.
1.首先当然得安装Zend studio 啦.(不废话嘛)
2.下载Smartypdt, http://code.google.com/p/smartypdt/,
3.安装Smartypdt插件在Zend studio上,参考http://code.google.com/p/smartypdt/wiki/InstallSmartyPDT
Requirements¶
Download PDT 2.2 / Studio 7.1 all-in-one from Zend's site
Install¶
You requested info about how to install SmartyPDT 0.9.0 on Galileo, so i will try to explain the steps:
- Download latest SmartyPDT package (currently 0.9.0) from http://code.google.com/p/smartypdt/
- Be sure that the .TPL files are not associated with any content type (file type). In Eclipse, go to Window->Preferences->General->Content Types and under the Text section check HTML and PHP Content Type If you see that the .TPL is associated with anything, just delete those entries.
- Go to Help-> Install New Software
- At the Work With section click on the Add... button. Give the new "Site" a name and click on Archive... and select the downloaded .ZIP archive with smartypdt. Go back to the Install New Software window and select the newly added "site". If the "Group items by category" check-box is checked, uncheck it. Now you should be able to see 1 item in the software list named "Smarty Feature"
- Select the Smarty Feature, click Next> and from here afterwards it shouldn't be a problem.
- If you are prompted that this is an unsigned package, just ignore the warning and install it anyway.
- After the installation completes, restart Eclipse and it should be working.
- Define a default PHP executable of type 'Zend Debugger' (only if you install vanilla Eclipse PDT):
- In Eclipse go to Window->Preferences->PHP->PHP Executables Click on the Add button. Enter a name for that executable definition, for example "PHP localhost", complete the 2 fields which ask you for the PHP executable path (the PHP binary CLI executable) and php.ini path. Be sure that the PHP debugger is the Zend Debugger.
英语不太好,大致意思,相信能开发的人应该看得懂,还是简单说两下吧.
1.这点很重要,直接导致我从eclipse换至Zend studio.由于在 PHP Content Type 下的.tpl is locked,所以,你拿它没办法.Zend studio在安装时就要你是否关联.tpl,我是都关联,后来在安装文件下,../Zend/Zend Studio - 7.2.0/plugins/org.eclipse.php.core_2.2.0.v20100324-1300/ 下的 plugins xml 文件里删除
file-extensions="php,php3,php4,php5,phtml,inc,phps,tpl" 为这样
file-extensions="php,php3,php4,php5,phtml,inc,phps",phps你要保留也可以.这样你安装的Smartypdt才能成功关联.tpl.
2.安装Smartypdt,Help-> Install New Software 在add 下Archive 选择你下载好的Smartypdt.zip,再OK就好了,不过不要点上下面的,"Group items by category" 和"Connet all updates ......",因为这样会很慢.
3.参照上面,
4,参照上面,
5.这点设置也很重要,我在开发过程中实际测试过,这样设会让你的Zend studio 运行得很正常轻松,参照上面第5点,将你的本地安装的PHP设为 Zend Debugger,的default.
好了,这样你的Zend studio就可以高效的为你调试Smarty了.Thanks.