2015-10-06 19:40:59 5012次浏览 0条回答 0 悬赏 10 金钱

我想使用phpqrcode生成二维码,我是直接解压放到vendor目录下吗?请各位大神能够详细解答一下。
我是按照文档说的,手动安装的方法,并在配置文件web.php中加入了一下配置:

$config = [
    'id' => 'basic',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => 'Pky8h3Lm-I286w68YA3eL3NCXBPjRRLg',
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'user' => [
            'identityClass' => 'app\models\User',
            'enableAutoLogin' => true,
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            // send all mails to a file by default. You have to set
            // 'useFileTransport' to false and configure a transport
            // for the mailer to send real emails.
            'useFileTransport' => true,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'db' => require(__DIR__ . '/db.php'),

        'aliases' => [
            '@qrcode' => '@vendor/phpqrcode',      //加入的配置
        ],
    ],
    'params' => $params,
];

请问我在控制器中想使用这个类库怎么使用呢?

    没有找到数据。
您需要登录后才可以回答。登录 | 立即注册
snms
见习主管

snms

注册时间:2015-09-16
最后登录:2015-10-17
在线时长:3小时24分
  • 粉丝1
  • 金钱215
  • 威望10
  • 积分345

热门问题