0

Surgery/PatientBundle/Constroller/RegistrationPatientBundleController にコントローラーがあり、Surgery/PatientBundle/Resources/public/images/test.jpg に画像があります。この画像へのパスは?コントローラーでこのコードを試しました

public testAction(){

     header ( 'Content-Type: image/jpeg' );
     $image = imagecreatefromjpeg("../Resources/public/images/test.jpg");
     imagejpeg($image);

しかし、ファイルが見つかりません。

4

1 に答える 1

0

試す :

$image => imagecreatefromjpeg(__DIR__.'/../Resources/public/images/test.jpg');
于 2013-02-14T13:56:19.097 に答える