Introspecting PHP Services
In this Topic ShowHide
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.
|
|

|
To perform PHP Introspection via
the Right Click Menu:
- Make sure you are in the Flash perspective, which can be
manually accessed by going to Window
| Open Perspective | Flash.
- 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.

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

The Service Operations dialog allows you to review all
of the methods that are included in your PHP class.
Click Finish
to complete the PHP Introspection.
Your PHP service is now connected to your Flex project.
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.

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

|
To perform PHP Introspection via
the Data/Services view:
- 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.

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

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

- Click Browse.
The Select PHP File dialog opens.

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

Click Next to
open the Service Operations dialog.

The Service Operations dialog allows you to review all
of the methods that are included in your PHP class.
Click Finish
to complete the PHP Introspection.
Your PHP service is now connected to your Flex project.
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.

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