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

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

WBOY
Release: 2016-06-06 20:26:48
Original
1170 people have browsed it

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

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

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

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

回复内容:

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

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

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

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

在model 前,用@var ModelName

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template