How to get code completion for variables into zend_view using netbeans 6.9.1?

家住魔仙堡 提交于 2019-12-09 23:55:53

问题


i'm evaluating to switch to netbeans ide for managing my zend_framework project;

i'd like to have autocompletion for variable's name into my view, for variables defined in actions as i see in this screencast,

http://netbeans.org/kb/docs/php/zend-framework-screencast.html ,

but i can't figure out.

When i digit $this-> in any view i can't see none variable's name.

I'd like a lot to use this feature.

Thank you, Mirco.


回答1:


You need to have Zend Framework either in the include path for the project within Netbeans or within the project itself.

You can then use cmd+space after a "->" to autocomplete an object's methods. If Netbeans doesn't know the object you can use /* @var $objInstance Object_Class_Name

Within a method call, you can use cmd+b to see the parameters of the method.




回答2:


Here is a code example for the view using Robs solution.

<?php
/* @var $this Zend_View */
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Zend Framework Default Application</title>
    </head>
    <body>
        <?php echo $this->layout()->content; ?>
    </body>
</html>


来源:https://stackoverflow.com/questions/4120571/how-to-get-code-completion-for-variables-into-zend-view-using-netbeans-6-9-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!