【发布时间】:2018-02-23 14:22:30
【问题描述】:
我实现了这个库来在我的 laravel 项目中生成条形码图像 https://github.com/milon/barcode
一切正常,图像生成正确,但现在我想将条形码图像保存在我的存储文件夹中
对于条形码图像,我只需在数据库中添加一个值,然后将该值转换为条形码图像
这是我在数据库中添加值的代码:
<div class="form-group {{ $errors->first('barcode', 'has-error') }}">
<label for="title" class="col-sm-3 control-label">
Barcode
</label>
<div class="col-sm-6">
{{ Form::text('barcode', NULL, ['class' => 'form-control required', 'minlength' => 3]) }}
</div>
</div>
这是我用来生成条形码图像的代码:
{!! DNS1D::getBarcodeHTML("$employee->barcode", "C39")!!}
【问题讨论】:
-
"$employee->barcode"不应使用引号。 -
仅仅因为php可以执行代码,并不意味着它应该。 Difference between single quotes and double quotes.