4.09.2006

Zend Inspectors Window

NOTE: Having recently started using Zend at work and at home for projects, I think it's a great product that has sped up my PHP development time quite a bit. I will therefore be posting some tips and tricks on its use in the following weeks.


The Inspectors Window displays the methods/functions and any included/required files for the PHP program that you are currently working on. For PHP class files, it will also show all the class variables (properties) and any other inherited methods.


To display the Inspectors Window in Zend, you can either go to the View menu and select Show/Hide Inspectors or click on the "Inspectors" area in the side navigation. Then you can click on the "File" button at the top of the window. You can also inspect all the files for a given "Project" but that's beyond the scope of this tip.


To test it out, bring up a PHP file that has functions in it, and look in the Inspectors area. It will show you all the functions available. It also shows the parameters that need to be sent for each function. If the function returns a value, the Inspectors window attempts to figure what data type the returned value is (that's why there's a lot of "unknowns" listed. The return value needs to be specified in comments using PHPDoc code (which will be a future tip).


Clicking on the function name in the Inspectors window takes you right to the code where the function is declared... kind of a function bookmarket. Pretty nifty.


When working with objects/class files, the Inspectors window is even more helpful. If you have any object inheritance, it will drill up into each parent object and show you those inherited methods as well. This means theres' hardly ever a need to do a print_r(get_class_methods($this));


If you have any questions on this, please feel free to ask. Until next time, happy inspecting!!

No comments:

Post a Comment