Yii2.0:配置urlmanager规则后无法显示生成的图像

时间:2017-06-14 01:02:21

标签: php yii2

main.php:

'urlManager' => [
    'enablePrettyUrl' => true,
    // 'showScriptName' => true,
    // 'enableStrictParsing' => false,
    'rules' => [
        'metting/<sid:\d+>/<b:\w>'=>'metting/attender/index',
    ],
 ]

查看页面:

<img src="<?= Url::to(['ticket/qrcode', 'bank' => urlencode($ticket->linkUrl)])?>">

qrcode行动:

public function actionQrcode ($bank) {
    $level = \dosamigos\qrcode\lib\Enum::QR_ECLEVEL_L;
    $bank = urldecode($bank);
    return \dosamigos\qrcode\QrCode::png($bank,false,$level,4,0);
}

删除规则配置时,图像正常显示。

0 个答案:

没有答案