Abhishek
Abhishek

Reputation: 1466

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.

Upvotes: 6

Views: 4760

Answers (8)

ashraf mohammed
ashraf mohammed

Reputation: 1350

go to function definition

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...)

Upvotes: 2

Amit Mhaske
Amit Mhaske

Reputation: 471

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

Upvotes: 0

Hammad Anwer
Hammad Anwer

Reputation: 147

Press F3 in eclipse and you will find the declaration.

Upvotes: 2

Abhishek
Abhishek

Reputation: 1466

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.

Upvotes: 0

Benoit
Benoit

Reputation: 3598

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.

Upvotes: 0

user168998
user168998

Reputation: 78

phpDesigner can do that

Upvotes: 0

Benoit
Benoit

Reputation: 3598

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

Upvotes: 2

Sarfraz
Sarfraz

Reputation: 382806

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.

Upvotes: 0

Related Questions