Home  >  Article  >  Backend Development  >  IDE中如何设置,可以让yii2 createObject创建的实例自动提示

IDE中如何设置,可以让yii2 createObject创建的实例自动提示

WBOY
WBOYOriginal
2016-06-06 20:26:481149browse

如果是实例属性,可以通过 PHPDOC的@property 来设置

但是函数内变量就做不到了。

<code>$tag_model = Yii::createObject(TagEntity::className());
$tag_model->batchAddTags($add_tags);
$tag_model->addQuestionTag();</code>

如何做到$tag_model可以自动提示方法呢?

回复内容:

如果是实例属性,可以通过 PHPDOC的@property 来设置

但是函数内变量就做不到了。

<code>$tag_model = Yii::createObject(TagEntity::className());
$tag_model->batchAddTags($add_tags);
$tag_model->addQuestionTag();</code>

如何做到$tag_model可以自动提示方法呢?

在model 前,用@var ModelName

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn