2011-09-08 68 views
1

我已經將所有圖像存儲在數據庫(Mysql)中,但是當我用Fancybox查看該圖像時,它只顯示二進制數據,而不是圖像。用Fancybox顯示URL的問題

我的代碼:

<a href="/controller/action/id" class="group" rel="fancy"> 
    <img src="/controller/action/id/thumb" /> 
</a> 

對於網址 「/控制器/操作/ ID」 我用這個代碼返回圖像:

header("Content-type: {$image['Image']['image_type']}"); 
echo $image['Image'][ $size ]; 

我使用CakePHP。

謝謝。

回答

1

Nedd指定'type':'image'。

4
$.fancybox({ 
      'type':'image' 
     }); 

這解決了我的問題。