欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

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

程序员文章站 2022-04-25 23:21:03
...
这样配置的组件,phpstorm不能提示组件内的方法和属性。
'components'=>[
    'box'=>[
        'class'=>'frontend\components\Box'
    ]
]

回复内容:

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

'components'=>[
    'box'=>[
        'class'=>'frontend\components\Box'
    ]
]

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

参考资料
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/