Tuesday, May 1, 2012
How to create Setter and Getter in PHP using Zend Studio?
Tuesday, May 1, 2012 by v

In order to create easy 'Set' and 'Get' function calls, Zend studio has capability to create Getter and Setter automatically. In this tutorial, you will see how you can set getter and setter automatically.
Steps to automatically create Setter and Getter in PHP using Zend Studio:
Step 1: For the class you want to generate Setter and Getter, place your cursor in it.
Step 2: Right click and select Source >> Generate Getter and Setter. Alternatively, you can go on menu bar, select Source and under it click Generate Getter and Setter.

Step 3: The variables, that may need a Getter/Setter, for them, a dialogue box will be displayed.

Step 4: Here you will require to select few things like Variables, Insertion Point, Sort, Access Modifiers and Generate method comments.
Step 5: After choosing appropriate options, click Ok.
Step 6: Then for selected functions, relevant Setter and Getter will be generated as shown below:

Subscribe to:
Post Comments (Atom)
0 Responses to “How to create Setter and Getter in PHP using Zend Studio?”
Post a Comment