Yii2 IDE插件 [ 2.0 版本 ]
yii2,在web.php文件中,加入了redis Component后,phpstrom使用Yii::$app->redis->
没有办法显示包含的方法;
<?php
/**
* Yii app stub file. Autogenerated by yii2-stubs-generator (stubs console command).
* Used for enhanced IDE code autocompletion.
* Updated on 2020-04-24T08:10:26+0000
*/
class Yii extends \yii\BaseYii
{
/**
* @var BaseApplication|WebApplication|ConsoleApplication the application instance
*/
public static $app;
}
/**
* @property app\common\services\Service $service
* @property yii\queue\redis\Queue $queue
* @property yii\caching\FileCache $cache
* @property yii\swiftmailer\Mailer $mailer
* @property yii\db\Connection $db
* @property yii\redis\Connection $redis
* @property yii\elasticsearch\Connection $elasticsearch
* @property yii\mongodb\Connection $mongodb
**/
abstract class BaseApplication extends yii\base\Application
{
}
/**
* @property app\common\services\Service $service
* @property yii\queue\redis\Queue $queue
* @property yii\caching\FileCache $cache
* @property yii\swiftmailer\Mailer $mailer
* @property yii\db\Connection $db
* @property yii\redis\Connection $redis
* @property yii\elasticsearch\Connection $elasticsearch
* @property yii\mongodb\Connection $mongodb
**/
class WebApplication extends yii\web\Application
{
}
/**
* @property app\common\services\Service $service
* @property yii\queue\redis\Queue $queue
* @property yii\caching\FileCache $cache
* @property yii\swiftmailer\Mailer $mailer
* @property yii\db\Connection $db
* @property yii\redis\Connection $redis
* @property yii\elasticsearch\Connection $elasticsearch
* @property yii\mongodb\Connection $mongodb
**/
class ConsoleApplication extends yii\console\Application
{
}
可以把这段代码 复制到 Yii.php中,然后把文件放在 vendor目录下,这样就可以显示了;
TIP:\vendor\yiisoft\yii2\Yii.php 最好把这个文件 右键-》mark as plain text 防止phpstrom识别出2个Yii.php
丶巡山 江苏南京
注册时间:2020-10-30
最后登录:2022-07-25
在线时长:6小时27分
最后登录:2022-07-25
在线时长:6小时27分
- 粉丝3
- 金钱23205
- 威望10
- 积分23365
共 0 条评论