Пример #1
0
 public function action_image($id = null, $name = null)
 {
     $pass = Model_Pass::find($id);
     $manager = new Pass_File_Manager($pass);
     $path = $manager->file_path($name . '.png');
     $body = null;
     if (file_exists($path)) {
         $info = \Fuel\Core\File::file_info($path);
         $body = file_get_contents($path);
     }
     return Response::forge($body, 200, array('Content-Type' => 'image/png', 'Cache-Control' => 'no-cache, no-store, max-age=0, must-revalidate', 'Content-Length' => $info['size']));
 }