I have a question about Barcode generation in Zend Framework 2.
All the time I get an error :
PHP Fatal error: Class 'Zend\Loader' not found in /var/www/vhosts/mydomain.com/httpdocs/vendor/ZendFramework/library/Zend/Validator/Barcode.php on line 110
The code I use is :
// Only the text to draw is required
$barcodeOptions = array('text' => 'ZEND-FRAMEWORK');
// No required options
$rendererOptions = array();
$imageResource = Barcode::factory(
'code39', 'image', $barcodeOptions, $rendererOptions
)->render();
echo '<pre>';
var_dump($imageResource);
When I delete the render function chained to the barcode::factory
I see a 'Zend\Barcode\Renderer\Image'
object. When I run the render function I get the error.
I've got the code from the Zend Framework documentation. I couldn't find good ZF2 documentation about this. Has anybody had this problem before? What can I do about it?