duanmo6937 2012-12-26 03:09
浏览 43
已采纳

DooPHP:如何从控制器动作输出图像?

In one of the actions I need to return an image to the user. Is there a way to achieve this with DooPHP?

Sample action code:

public function view() {
   $path = $this->params['path']; // contains path to the image

   // $this->render($path); // does not work
}

Thanks and happy holidays!

  • 写回答

1条回答 默认 最新

  • duanche2007 2012-12-26 17:26
    关注

    I wasn't able to find anything in the DooPHP framework and simply ended doing it the php way as described in this answer: https://stackoverflow.com/a/900228/39843

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画