Home  >  Article  >  Backend Development  >  php框架 - Yii2自己写的组件为何phpstorm无法识别呢?

php框架 - Yii2自己写的组件为何phpstorm无法识别呢?

WBOY
WBOYOriginal
2016-06-06 20:16:041055browse

这样配置的组件,phpstorm不能提示组件内的方法和属性。

<code>'components'=>[
    'box'=>[
        'class'=>'frontend\components\Box'
    ]
]</code>

回复内容:

这样配置的组件,phpstorm不能提示组件内的方法和属性。

<code>'components'=>[
    'box'=>[
        'class'=>'frontend\components\Box'
    ]
]</code>

<code>/** @var \frontend\components\Box $test */
$test = Yii::$app->box;</code>

参考资料
http://www.yiichina.com/tutorial/487

视频
http://pan.baidu.com/share/link?shareid=1801456562&uk=1191547431&fid=322257966212691
http://www.tudou.com/programs/view/UuM-7fbcLj4/

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