在laravel(4.2)blade中显示php文件中的图像

在laravel(4.2)blade中显示php文件中的图像,php,laravel,laravel-4,Php,Laravel,Laravel 4,我不熟悉Laravel4.2,我在想如何显示从php文件生成的图像 这是我的php文件(capt.php) 指定指向生成的图像的链接,而不是指向生成它的脚本的链接,如果将图像另存为img/yourmage.jpg,则执行{{HTML::image(URL::to('img/yourmage.jpg'))}谢谢!我会试试的!:) <?php session_start(); $code=rand(100000,999999); $_SESSIO

我不熟悉Laravel4.2,我在想如何显示从php文件生成的图像

这是我的php文件(capt.php)


指定指向生成的图像的链接,而不是指向生成它的脚本的链接,如果将图像另存为img/yourmage.jpg,则执行{{HTML::image(URL::to('img/yourmage.jpg'))}谢谢!我会试试的!:)
<?php
        session_start();
        $code=rand(100000,999999);
        $_SESSION["code"]=$code;
        $im = imagecreatetruecolor(50, 24);
        $bg = imagecolorallocate($im, 189, 195, 199); //background color blue
        $fg = imagecolorallocate($im, 255, 255, 255);//text color white
        imagefill($im, 0, 0, $bg);
        imagestring($im, 5, 5, 5,  $code, $fg);
        header("Cache-Control: no-cache, must-revalidate");
        header('Content-type: image/png');
        imagepng($im);
        imagedestroy($im);
?>
{{ HTML::image(URL::to('capt.php')) }}