我想生成html属性,例如data-inputmask ='“ mask”:“(999)999-9999”',但是loravel集体打印data-inputmask =“'mask':'(999)999-9999' ”,然后使用“&#0 3 9”。为什么?
{!! Form::text('mobile', null, ['class' => 'form-control text-left', 'data-inputmask' => '"mask": "(999) 999-9999"', 'data-mask']) !!}
laravel collective output:
<input class="form-control text-left" data-inputmask="'mask': '(999) 999-9999'" data-mask name="phone" type="text" id="phone">
但是我想要
<input class="form-control text-left" data-inputmask="'mask': '(999) 999-9999'" data-mask name="phone" type="text" id="phone">
答案 0 :(得分:0)
尝试将您的单引号替换为data-inputmask
的双引号:
{!! Form::text('mobile', null, ['class' => 'form-control text-left', 'data-inputmask' => "'mask': '(999) 999-9999'", 'data-mask']) !!}
有关single quoted strings的更多信息。