gpt4 book ai didi

PHP:如何告诉 Eclipse/Netbeans 一个对象属于某个类,以启用 Intellisense

转载 作者:可可西里 更新时间:2023-10-31 22:07:26 28 4
gpt4 key购买 nike

我使用 Kohana 3.x 作为我的 Web 应用程序框架(使用 MVC 模式)并使用 Propel 作为我的 ORM。在我的 Controller 中,我创建了一个对象来表示拥有当前 session 的配置文件:

$this->currentProfile = ProfileQuery::create()->findPK($profileId);

我将对象传递给我使用的 View :

View::set_global('myProfile', $this->currentProfile); // c

现在我可以在我的 View 中使用对象“myProfile”。但问题是,在这个 View 中,Netbeans 和 Eclipse 都不知道对象的类。所以我不能再使用 Intellisense(这是最初使用 Propel 的关键功能之一)。所以请帮助我:如何告诉 Eclipse 和/或 Netbeans 我的对象“myProfile”是哪个类?

最佳答案

Netbeans 解决方案:将其放在模板的开头:/* @var $myProfile Profile */

或者:键入 vdoc 并按 Tab。

关于PHP:如何告诉 Eclipse/Netbeans 一个对象属于某个类,以启用 Intellisense,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4370328/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com