我刚刚注意到对象方法自动完成不会显示要自动完成的方法列表。我在使用 $PDO->bindParam() 方法时看到了它。通常,我可以在方法箭头后开始输入“bi”,自动完成将直接与方法一起出现。现在,这些方法不会出现,但是我个人定义的类中的方法和属性会出现。此外,它还显示“未找到 PHPDoc”。
这很奇怪,因为它以前运行良好。我唯一能想到的是,我不得不从 Netbeans 中删除该项目,然后使用“现有来源的新项目”将其恢复。
我需要重新连接的文档文件的链接是否已损坏?我将如何解决这个问题?另外,如果这是一个愚蠢的问题,我们深表歉意。
最佳答案
- 代码补全
要完成上下文相关的代码,请按照下列步骤操作:
Include Yii folder (assuming it is properly placed outside project directory)
Open "File > Project properties > PHP Include Path" and add the Yii framework root path
Ignore yiilite.php to avoid doubled/missing documentation
Open "Tools > Options > Miscellaneous > Files"
Add to the front of "Files Ignored by the IDE" the file "^(yiilite\.php|CVS|SCCS|...."
Restart NetBeans
Code completion in view files
Add the following PHPDoc statement at the head of the file to use code completion in view files. (you may add additional passed parameters as well)
/* @var $this PostController */
/* @var $model Post */
$this->getSomeProValue(); // possible with code completion
$model->author; // possible with code completion
用法:
Typing suggestions: Ctrl-Space
Show Function parameters: Ctrl-P
Comment your own code with PHPDoc style. Here's a good example.
关于php - Netbeans 中的 Yii 框架 - 对象方法自动完成未出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24663687/