And*_*rew 6 aptana eclipse zend-framework code-completion
我正在使用Aptana Studio 3(基于Eclipse构建)来编辑我的Zend Framework应用程序.当我编辑视图脚本时,我希望我的IDE提供代码完成/自动完成.
<?php echo $this->form...
Run Code Online (Sandbox Code Playgroud)
由于视图助手函数不是实例化的类,我没有开箱即用的这种功能.我怎样才能将这种功能添加到Eclipse中?
例如,您唯一能做的就是使用变量类型提示
<?php
/* @var $form Zend_Form */
$form = $this->form;
Run Code Online (Sandbox Code Playgroud)
然后,您将获得$form属性和方法的代码完成.
视图助手大多可以被视为相同,例如
<?php
/* @var $headLinkHelper Zend_View_Helper_HeadLink */
$headLinkHelper = $this->getHelper('HeadLink');
Run Code Online (Sandbox Code Playgroud)
由于您使用的是 Aptana Studio,而不是 PDT,因此我将添加到上面发布的评论(作为答案)。
Aptana Studio 中正确的语法是:
/**
* @var Foobar
*/
$obj; // You have to call the variable here (redundant call...)
$obj-> // will code assist the FooBar functions.
Run Code Online (Sandbox Code Playgroud)
这个多余的调用是一个交易破坏者(恕我直言),所以我正在努力获得额外的支持,比如@Phil的答案中建议的PDT特殊@var语法)。
/* @var $obj Foobar */
$obj-> // will code assist the FooBar functions.
Run Code Online (Sandbox Code Playgroud)
无论如何,为了向后兼容,Studio 的下一个版本都将支持两者。
希望有帮助