【发布时间】:2015-01-06 13:25:24
【问题描述】:
同样的工作可以通过以下代码完成:
header('Content-Type:image/jpeg');
readfile('a.jpg');
但是现在我真的被 Yii2 的\yii\web\Response.搞糊涂了
我的困惑是这样的:
-
创建一个控制器和动作来提供图片
见下文
class ServerController extends \yii\web\Controller { public function actionIndex($name) { // how to response } } 访问
http://example.com/index.php?r=server/index&name=foo.jpg
感谢您的回答!
【问题讨论】:
-
请解释您的问题到底是什么
标签: yii2