How to get Zend Framework helper code completion in Eclipse (Aptana Studio 3)?

I am using Aptana Studio 3 (built on Eclipse) to edit my Zend Framework application. When I edit the view of the script, I would like my IDE to provide code completion / autocomplete.

<?php echo $this->form... 

Being that helper functions of a view are not exactly instantiated classes, I don't get that kind of functionality out of the box. How can I add such features in Eclipse?

+6
source share
2 answers

Since you are using Aptana Studio, not PDT, I will add the comment I wrote 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. 

This redundant call is a transaction breaker (IMHO), so I am working on additional support, for example, using the special @var syntax for PDT suggested by @Phil).

 /* @var $obj Foobar */ $obj-> // will code assist the FooBar functions. 

In any case, for backward compatibility, both will be supported in the next version of Studio.

Hope that helps

+1
source

The only thing you can really do is use hints like variables, like

 <?php /* @var $form Zend_Form */ $form = $this->form; 

Then you get code completion for the properties and methods of $form .

Viewing assistants can basically be handled the same way, for example

 <?php /* @var $headLinkHelper Zend_View_Helper_HeadLink */ $headLinkHelper = $this->getHelper('HeadLink'); 
+5
source

Source: https://habr.com/ru/post/890446/


All Articles