Creating a New PHP Class

This procedure demonstrates how to create a new PHP class using the new PHP class wizard.

 

 

Instructions on how to complete a procedure

To create a new PHP class:

  1. In PHP Explorer view, right-click the project/file in which you want to create the new class and select New | Class.
    The New PHP Class wizard is displayed.

  1. Enter the following details:

  • Source Folder - If necessary, click Browse to change the source folder.

  • Class location - Select one of the following options:

    • Create New File - A new PHP file will be created in which the new class will be inserted

    • Add in existing file - The class will be created in an existing file.
      Click Browse to select the file in which it will be created and select whether it will be created as the 1st PHP Block in the file or as a New PHP Block at the end of the file.

  • Class Name - Enter the name for the class. If you chose the Create New File option, this will also be the name of the file.

  • Superclass - Click Browse to select a Superclass to extend.

  • Interfaces - Click Add to select interaces to extend/implement.

  • Method stubs - mark the checkboxes of the method stubs to be created (if any) from the following options:

    • Constructor

    • Destructor

    • Inherited abstract methods

  • Comments - mark the checkboxes of the comments to be created (if any) from the following options:

    • PHPDpc Blocks

    • TODOs

  1. Click Finish.

The new class will be created with the required code.