php - Netbeans 中的 Yii 框架 - 对象方法自动完成未出现

标签 php netbeans yii autocomplete

我刚刚注意到对象方法自动完成不会显示要自动完成的方法列表。我在使用 $PDO->bindParam() 方法时看到了它。通常,我可以在方法箭头后开始输入“bi”,自动完成将直接与方法一起出现。现在,这些方法不会出现,但是我个人定义的类中的方法和属性会出现。此外,它还显示“未找到 PHPDoc”。

这很奇怪,因为它以前运行良好。我唯一能想到的是,我不得不从 Netbeans 中删除该项目,然后使用“现有来源的新项目”将其恢复。

我需要重新连接的文档文件的链接是否已损坏?我将如何解决这个问题?另外,如果这是一个愚蠢的问题,我们深表歉意。

最佳答案

  1. 代码补全

要完成上下文相关的代码,请按照下列步骤操作:

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/

相关文章:

php - 使用 Yii 框架从迁移创建数据库模式

php - 如何进行多插入和获取ID

php - WampServer 3.0.0 AH01630 : client denied by server configuration:

java - 读取/写入 jar 文件中的属性文件

javascript - 文本不会转移到 POST 变量

java - 我应该在哪里放置文本文件以供 netbeans 读取?

java - POI API APACHE 导入到 netbeans

yii - Yii 数据库迁移错误

php - 使用 Doctrine Extensions Tree Nested 集获取家长中的 child 帖子

php - 如何在 IF 语句中满足某个条件时停止执行 PHP 脚本?