I am using Aptana Studio 3 (built on Eclipse) to edit my Zend Framework application. When I am editing a view script, I would like my IDE to provide code completion / auto-complete.
<?php echo $this->form...
Being that the view helper functions are not exactly classes that are instantiated, I don't get this sort of functionality out of the box. How can I go about adding this sort of functionality to Eclipse?
The only thing you can really do is use variable type hints, for example
<?php
/* @var $form Zend_Form */
$form = $this->form;
You will then get code completion for $form
properties and methods.
View helpers can mostly be treated the same, eg
<?php
/* @var $headLinkHelper Zend_View_Helper_HeadLink */
$headLinkHelper = $this->getHelper('HeadLink');
Since you are using Aptana Studio, and not PDT, I'll add to the comment I posted above (as an answer).
The correct syntax in Aptana Studio is:
/**
* @var Foobar
*/
$obj; // You have to call the variable here (redundant call...)
$obj-> // will code assist the FooBar functions.
That redundant call is a deal breaker (IMHO), so I'm working on having additional support, like with the PDT special @var syntax suggested at @Phil's answer).
/* @var $obj Foobar */
$obj-> // will code assist the FooBar functions.
In any case, for backward compatibility, both will be supported in the Studio's next release.
Hope that helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With