2016-12-22 39 views
0

我需要將選擇的產品代碼從下拉列表傳輸到條形碼生成器att。我如何將下拉列表中的值存儲到條形碼小部件?

<?php $dataStorageLocation = ArrayHelper::map(StorageLocation::find()>all(),'storage_id','storage_id'); ?> 

<?php $form = ActiveForm::begin(); ?> 
<div class="col-sm-12 col-xs-12">  

    <?= $form->field($model, 'product_code', ['template' => '<div class="col-sm-3   text-right">{label}</div><div class="col-sm-9 col-xs-12">{input}</div>{hint}  {error}'])->dropDownList($dataStorageLocation); 

$optionsArray = array(
'elementId'=> 'showBarcode', /* div or canvas id*/ 
'value'=> '$model', /* value for EAN 13 be careful to set right values for each barcode type */ 
'type'=>'code128',/*supported types ean8, ean13, upc, std25, int25, code11, code39, code93, code128, codabar, msi, datamatrix*/ 

); 
echo BarcodeGenerator::widget($optionsArray); ?> 

</div> 

回答

0

我只在值內添加$ model-> product_code。

相關問題