PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Zend_Barcode Renderers

Renderers have some common options. These options can be set in four ways:

  • As an array or a Zend_Config object passed to the constructor.

  • As an array passed to the setOptions() method.

  • As a Zend_Config object passed to the setConfig() method.

  • As discrete values passed to individual setters.

Example 66. Different ways to parameterize a renderer object

<?php
$options 
= array('topOffset' => 10);

// Case 1
$renderer = new Zend_Barcode_Renderer_Pdf($options);

// Case 2
$renderer = new Zend_Barcode_Renderer_Pdf();
$renderer->setOptions($options);

// Case 3
$config   = new Zend_Config($options);
$renderer = new Zend_Barcode_Renderer_Pdf();
$renderer->setConfig($config);

// Case 4
$renderer = new Zend_Barcode_Renderer_Pdf();
$renderer->setTopOffset(10);

Zend Framework