Introspecting PHP Services

In this Topic Hide

Performing PHP Introspection via the Right Click Menu

Performing PHP Introspection via the Data/Services View

 

PHP Introspection allows you to connect your Flex project to a pre-defined PHP service. This makes the methods in the PHP service easily accessible while developing the client side of your application.

PHP Introspection will connect the PHP service you choose with the Flex project currently associated with it, as defined in the PHP Support Properties page.

 

A PHP service is a PHP class containing PHP methods. The PHP methods you define in your PHP service are used as operations for the Flex side of your application. You can use an existing PHP service, or write one in a PHP file.

Important Note:

The PHP file must have the same name as the PHP class within it.

Before performing PHP Introspection you must create a PHP class in a PHP file, and enable PHP Support.

Performing PHP Introspection via the Right Click Menu

This procedure describes how to perform PHP Introspection from the Right Click Menu of your PHP service.

 

 

Instructions on how to complete a procedure

To perform PHP Introspection via the Right Click Menu:

  1. Make sure you are in the Flash perspective, which can be manually accessed by going to Window | Open Perspective | Flash.
  2. In the Package Explorer or PHP Explorer view select Create PHP Service for Flex from the Right Click Menu of your PHP service.
    -Or- go to Data | Connect to Data/Service.
    The Configure Zend Studio PHP Service dialog opens.

configure_zs_php_service.png

  1.  The service details (service name, service package, and data type package) are automatically generated according to the PHP class.
  2. Click Next to open the Service Operations dialog.

service_operations.png

  1. The Service Operations dialog allows you to review all of the methods that are included in your PHP class.

  2. Click Finish to complete the PHP Introspection.
    Your PHP service is now connected to your Flex project.

  3. Select your Flex project in the Package Explorer view, and open the Data/Services view to see all the public methods included in the PHP service.

data_services_view.png

After performing PHP Introspection, you can bind the data. For more information see Binding.

Performing PHP Introspection via the Data/Services View

This procedure describes how to perform PHP Introspection from the Data/Services view.

 

 

Instructions on how to complete a procedure

To perform PHP Introspection via the Data/Services view:

  1. Select your Flex project in the Package Explorer view and go to the Data/Services view, which can be opened manually by going to Window | Show View | Data/Services.

data_services_view_empty.png

  1. Click the Connect to Data/Service link.
    The Select Service Type dialog opens.

select_service_type.png

  1. Select PHP by Zend and click Next to open the Configure Zend Studio PHP Service dialog.

configure_zs_php_services.png

  1. Click Browse.
    The Select PHP File dialog opens.

select_php_file.png

  1. Select the PHP file you would like to use and click OK to go back to the Configure Zend Studio PHP Service dialog.
    All the Service details are automatically configured according to the PHP Class you selected.

configure_zs_php_service.png

  1. Click Next to open the Service Operations dialog.

service_operations.png

  1. The Service Operations dialog allows you to review all of the methods that are included in your PHP class.

  2. Click Finish to complete the PHP Introspection.
    Your PHP service is now connected to your Flex project.

  3. Select your Flex project in the Package Explorer view, and open the Data/Services view to see all the public methods included in the PHP service.

data_services_view.png

After performing PHP Introspection, you can bind the data. For more information see Binding.

 

 

Related Links

Related Links:
Binding

Enabling/Disabling PHP Support