Searching for PHP Elements

Searching for PHP elements is a functionality that allows you to search for PHP elements with your defined specifications. PHP elements are classes, functions, constants, types, methods and references/declarations that are used in your code. Use this option if you want to locate one of these elements in your workspace, project or in a single file.

Note:

For information about the "Search" tab in the "Search" dialog, read below. To learn more about the additional tabs in the "Search" dialog see File Search in the Workbench User Guide. If you are using the Remote Search option, be aware that it does not search all of the resources of the remote server.

This procedure describes how to search for PHP elements (classes, functions and constants) within your files and projects.

 

 

ref_icon.png

To search for a PHP element:

  1. From the Menu Bar go to Search | Search -or- press Ctrl+H.
    The "PHP Search" dialog will open.

PHP Search

  1. Enter a search string. You have the option of using Wildcards.

     You can make your search case sensitive by selecting the "Case sensitive" box.

  1. Select whether to search for a:

  • Type - A class (This option will search for both methods and fields.)

  • Method - A function

  • Field - A constant

  1. Select whether to limit your search to:

  • Declarations - The location where the type, method, or field are defined.

  • References - Anywhere the type, method, or field are referred to.

  • All occurrences - Anywhere the type, method, or field are referred to or declared.

  1. To extend your search to include interpreter system libraries, select the "Search the Interpreter system libraries" box. This allows PDT to search in the libraries of the PHP version you have selected in the PHP Interpreter Preferences.

  2. Select whether to search in your:

  • Workspace - The entire workspace.

  • Selected resources - Select these in PHP Explorer view before opening the "Search" dialog. All sub-files and sub-folders within the selected resource will be included in the search.

  • Enclosing projects - The projects which the selected resources are in.

  • Working Set - Click Choose... to select the required Working Set.

  1. Click Search

The Search view will open displaying the results of the search.

To go to an element, double-click the required option from the search view.

search_results.png

Note:

By default, the File Search, Remote Search, Task Search, Java Search and JavaScript Search dialogs will be tabbed with the PHP Search dialog. To make these unavailable, click Customize... within the PHP Search dialog and unmark required options.

Hotkeys

The following hotkeys are available:

Action

Shortcut

Esc / Alt+F4

Closes the Search dialog.

Alt + A

Brings the cursor to the "Search string" field.

Alt + I

 Checks/unchecks the "Case Sensitive" checkbox.

Alt + T

Checks "Type" in the "Search For" box.

Alt +M

Checks "Method" in the "Search For" box.

Alt +F

Checks "Field" in the "Search For" field.

Alt +L

Checks "Declarations" in the "Limit To" field.

Alt +R

Checks "References" in the "Limit To" field.

Alt +O

Checks "All occurrences" in the "Limit To" field.

Alt +Y

Checks/unchecks the "Search the Interpreter system libraries"field.

Alt + W

Selects "Workspace" in the "Scope" field.

Alt + D

Selects "Selected resources" in the "Scope" field.

Alt + J

Selects "Enclosing projects" in the "Scope" field.

Alt + K

Selects "Working set" in the "Scope" field.

Alt + H

Opens the "Select Working Sets" dialog.

Alt + S

Performs the search and shows the results in the Search view.

Alt +Z

Opens the "Search Page Selection" dialog and allows you to customize the search page.

 

 

link_icon.png

Related Links:

Search Menu