开发者

Jump to function declaration in php

开发者_运维问答I have the following ide's for php

  1. Dreamweaver
  2. php-Eclipse
  3. Textpad

I wish to jump to a function's definition which is located in another file which is not yet open. How could I do that. I am studying a websites code and have the entire directory structure in my local root folder. I come across certain functions and I don't know in which file their definition is. Please suggest something.


In eclipse PDT IDE put mouse over class name, property, method or function name (must be in opened eclipse project) and press CTRL + clic.

It work with almost all declarations, even constants and class constants. In most case it will work, but it can have trouble with some dynamic property assignement like magic methods or certain injected dependency.

The file will be opened, and if target is in same file code view will scroll to the declaration


Press F3 in eclipse and you will find the declaration.


Jump to function declaration in php

To jump to function definition for Dreamweaver just add this extension: http://code.google.com/p/dwoop/.

Also you can add Autocomplete feature to Dreamweaver by going to Site --> Site Specific code hints --> select a folder which you want to scan for autocomplete --> save it with any custom name you want.

This works with any type of project (wordpress, codeigniter...)


I wish to jump to a function's definition which is located in another file which is not yet open.

I can suggest you about dreamweaver, the one i use. Point the cursor at the file that is included via php's include, require, etc or within link's href and src attribute and press Cntr+D and that file should open.

For functions, just right click anywhere on the document, in the context menu you should see the Functions link about all functions defined in the document.


phpDesigner can do that


In an opposite direction, and perhaps out of question's field, but if your code if OOP and you want to study it you can try automated tools to get UML view of its architecture , but these softwares are generally not free.


I found a way of going to the function definition. Using help in dreamweaver and selecting the option of searching wihtin a folder type 'function function_name()' and unselect all the checkboxes below. if you press find it will start opening pages which containg the expression or find all will not open any pages but show the list of all the pages in the bottom panel.


Well, I'm currently working with Dreamweaver CC. If you want to jump to Function Definition from code, just select the desired function and then right click -> then select "Find Selection" option or you can use "Shift+F3", and you will be redirected to the code where the function is defined. enter image description here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜