DooPHP: How to output an image from a controller action?

195 Views Asked by At

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

There are 1 best solutions below

0
On BEST ANSWER

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