Home  >  Article  >  Backend Development  >  The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:43:56860browse

因为个人原因转到PHP已经一星期有余,熟悉了简单的语法,也可以用PHP来实现CRUD了,算是迈出第一步吧,对PHP的感觉估计也和很多人一样,简单,好上手。

  或许你可以用Dreamweaver、Notepad++或者Editplus这样的东西完成你的系统,但所谓“工欲善其事,必先利其器”,偶认为一个给力的IDE对于新手还是很必要的,而Zend作为PHPer们公认的最前IDE,自然成为了我的选择,我安装的版本是7.2.1,本文就介绍一下自己对于这个“新”工具的改造吧,最后留几个问题让高手们给解决下。

  1、更改Zend工作目录

The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

 

  2、更改Zend字体

     依次进入Window——Preferences——General——Appearance——Colors and Fonts——Basic——Text Font进行修改,偶还是喜欢Consolas的16号:

 The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

 

  3、更改新建文档模板的默认设置

  默认情况下新建PHP文件自动生成的代码为:

    

  仅此一行,偶希望能新建PHP文件时可以生成闭合的PHP标签,所以依次进入Window -> Preferences -> PHP -> Editor -> Templates -> New simple PHP file修改:

 The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

  4、修改自动提示代码速度

  Zend是个慢性子,默认的代码提示延迟是500毫秒,显然不符合Coder们的急脾气,所以进入Window -> Preferences -> PHP -> Editor -> Content Assist ->Auto Activation,将代码自动提示的速度500设置成50:

The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

   5、新建模板

  Zend里面已经自带了很多模板了,大家可以进到上面修改默认新建PHP文件模板的地方去逛逛,但难免还会出现不够用的情况,所以我们需要新建模板:

The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

  注意在context中选择newphp,负责新建时无法找到模板名。

  6、更改快捷键

  这个和VS是类似的,相信大家难免对有些快捷键的键位不爽哈,比如会将Ctrl+K,C作为注释的快捷键,这明显是两只手才可以操作完成的工作,怎么快得起来哈,所以我们会进行修改,比如修改成Ctrl+E,C等,而Zend里默认加块注释是Ctrl+Shift+/,取消块注释是Ctrl+Shift+,而增加或取消单行注释,默认是切换Ctrl+/,偶依然不想两只手来操作,所以果断改掉,我改的单行注释切换是Ctrl+E,块注释是Ctrl+R,取消块注释是Ctrl+G。

  另外就是更改调试和VS的习惯一致,调试由F11改为F5,运行由Ctrl+F11改为Ctrl+F5,Step into由F5改为F11,Step Over由F6改为F10。

  以上两个部分的更改可在搜索框中输入“comment”和“debug”即可看到。

The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

  7、安装JSEclipse

JS的提示要强大,而Zend本身自带的稍弱,这里更好的选择是安装JSEclipse插件,我们依次进入Help -> Install newsoftware
  这里有两种安装方法,一种是添加在线安装地址 http://download.macromedia.com/pub/labs/jseclipse/autoinstall,还有当然就是下载安装包到本机,进行安装,如果你解压了就选Local找到本地文件夹确定,或者你懒得解压也可以直接选Archive即可。

The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

  一路Next,就可以安装完成了。。

  安装好要选择JSEclipse 为默认的Javascript编辑器才可以使用JSEclipse,依次进入Window -> Preferences -> General -> Editors -> File Assocaitions:

The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

  设置“Default”即可。

  同样,代码提示也修改的快一些:

The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

The original default value of “outline reparsing delay(ms)” is 500, and the default value of “Code Completion popup delay(ms)” is 200.

8. Window layout

Use Alt+Shift+Q, V to bring up the variable window to facilitate tracking the values ​​of related variables during debugging

In addition, you can call up the Debug and Debug OutPut windows to facilitate tracking and debugging

Also bring up the PHP Function window in Window - Show View. You can take a look when you are too lazy to open the manual.

The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

In order to make the final layout look pleasing to the eye, it still looks like VS. The lower part can be minimized to increase the work area.

The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

9: Annotation experience

When everyone adds a comment to a function in VS, they will enter three / in succession, so that the summary of the function can be added. I thought this function was available in Zend, but I discovered it by accident in a comment. , just type /** and then press Enter to add comments to the function. The effect is as shown:

The road to learning PHP - If you want to do your job well, you must first sharpen your tools (Zend configuration)_PHP tutorial

Okay, the above is probably my transformation of Zend. I have left a few that I commonly use in VS, but I haven’t found the implementation problems in Zend yet. I hope the experts can give me some guidance:

1. In VS, I will set all files to automatically wrap. That is, when a line of code cannot be displayed, it will be displayed in a new line instead of continuing to display, so that a horizontal scroll bar will appear, so you can drag the code around. , which greatly affects the readability of the code. I have only found that there is a "Toggle Word Wrap" option by right-clicking on the workspace to make the current page display a new line, but I have not found a function setting that allows all files to be wrapped uniformly.
2. In addition, there is also a "go to definition" function that is often used. Right-click on a function or variable to go to the definition, and then go to the line where the function or variable is initially defined. This is in the file It's more useful sometimes, but I haven't found it in Zend either.
3. Another common function is that when I enter a function or variable, Zend will definitely prompt, OK, suppose I accidentally click on something else, such as touching the touch pad, so because of the mouse click The reason is that the smart prompt box must have disappeared, right? At this time, is there a way to press a certain key to bring up the prompt box, without having to delete the function that is half typed and then start typing from the beginning, so that the prompt box can be brought out? Appear. This is Ctrl+J in VS, but I haven't found how to implement it in Zend.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478783.htmlTechArticleIt has been more than a week since I switched to PHP for personal reasons. I am familiar with the simple syntax and can also use PHP to implement CRUD. Well, this is the first step. I think I feel the same about PHP as many people do...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn