Barcode PHP Class Overview
The Kendo UI Barcode for PHP is a server-side wrapper for the Kendo UI Barcode widget.
The Barcode is part of Telerik UI for PHP, a
professional grade UI library with 90+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.
Getting Started
Configuration
Below are listed the steps for you to follow when configuring the Kendo UI Barcode for PHP.
Step 1 Make sure you followed all the steps from the introductory article on Telerik UI for PHP—include the autoloader, JavaScript, and CSS files.
Step 2 Add a Barcode with the default type
(Code39).
$barcode = new \Kendo\Dataviz\UI\Barcode('barcode');
$barcode->value("foo");
Step 3 Change the symbology to match your scenario.
$barcode = new \Kendo\Dataviz\UI\Barcode('barcode');
$barcode->value("foo");
$barcode->type("ean8");
Step 4 Output the chart by echoing the result of the render
method.
echo $barcode->render();
Reference
Existing Instances
You are able to reference an existing Barcode instance via the jQuery.data()
. Once a reference is established, use the Barcode API to control its behavior.
// Put this after your Kendo Barcode for PHP render() call
<script>
$(function() {
// Notice that the name of the barcode is used to get its client-side instance
var barcode = $("#barcode").data("kendoBarcode");
barcode.value("foo");
});
</script>