tags:

views:

158

answers:

5

HI, 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 struction in my local root folder. I come accross certain functions and I dont know in which file their definition is. Pls suggest something.Thanks

Screenshot: http://www.freeimagehosting.net/image.php?fe848ebded.jpg

A: 

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.

Sarfraz
the function is not defined in the same php file. I need to open the file which has the definition. What i had to do is to search for that word and browse thru all the occurences to find that file but it is very tedious.
aeonsleo
+2  A: 

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

Benoit
No its not doing that ..ive pasted a screenshot link pls check
aeonsleo
Nope your screenshot show highlight on selection, but if in your example variables $today_milestone and $upcoming_milestone are typed in the file (with cast or new declaration), and the source file of their class is parsed in eclipse cache (ie included in project, and visible in project explorer if created outside), you can do the CTRL + click. It will open the class file and point cursor to method declaration. In addition to new object instanciation and casts I know eclipse PDT also use docblocs to guess variable types, so it will be easier if your code has well-formed docblocks
Benoit
Its highlighting all the instances within the same document but the classs files are in separate folder. I am used to 'oop' but new to php. I cant see any include files either and am not sure of other include methods you are talking. I have done similar stuff in visual studio with C# and it works in eclipse too but not really getting it.
aeonsleo
yes it's a bit obscure, I think eclipse can not guess the right objects type so their methods can not be linked with their declaration. Also I'm talking about Eclipse version I use at work (3.4.2) with PDT, i can work differently in other versions or php plugins
Benoit
A: 

phpDesigner can do that

A: 

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.

Benoit
A: 

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.

aeonsleo