yii显示图片
public function actionYzm()
{
//getCaptcha1.jpg
$imgFullPath = \Yii::getAlias('@webroot').'\img\yzm\getCaptcha1.jpg';
$response = \Yii::$app->getResponse();
// return $this->renderContent($imgFullPath);
$response->headers->set('Content-Type', 'image/jpeg');
$response->format = \Yii\web\Response::FORMAT_RAW;
$response->stream = fopen($imgFullPath, 'r');
return $response->send();
// return $response->sendFile($imgFullPath);
}