这是下面的代码
class Home extends Public_Controller
{
/**
* Constructor method
*`enter code here`
* @author PyroCMS Dev Team
* @access public
* @return void
*/
public function __construct()
{
parent::__construct();
}
public function testimg(){
header("Content-type: image/png");
$image = imagecreatetruecolor(200, 200);
imagepng($image);
}
}
但是当我像(http://localhost/sitename/home/testimg)一样调用这个控制器时。我得到了下面的错误
无法显示图像“http://localhost/sitename/home/testimg”,因为它包含错误。
请帮我解决这个问题,我是 pyrocms 的新手。