我只想要一个操作来打印条形码图像,但我无法在 MVC 中使用它,我只需执行以下操作:
public function barcodeAction() {
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
Zend_Barcode::render($_GET['barcodeType'], 'image', $_GET, $_GET);
}
但是当我打电话时
/barcode?barcodeType=code39&text=ZEND-FRAMEWORK
我刚刚获得:“图像无法显示,因为它有错误”(或类似的东西,取决于浏览器)。谢谢!