Skip to content

Instantly share code, notes, and snippets.

@skoop
Created January 12, 2011 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skoop/775971 to your computer and use it in GitHub Desktop.
Save skoop/775971 to your computer and use it in GitHub Desktop.
<?php
public function executeBarcode(sfWebRequest $request)
{
$barcodeOptions = array(
'text' => $request->getParameter('text')
);
$barcodeOptions = array_merge(
$barcodeOptions,
$this->parseOptionalParameters(
$request->getGetParameters()
)
);
$rendererOptions = array();
$this->getResponse()->setContentType('image/png');
Zend_Barcode::factory(
$request->getParameter('type'),
'image',
$barcodeOptions,
$rendererOptions
)->render();
return sfView::NONE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment