我试图将PHP变量添加到输入类型数字,作为该字段中允许的最大值。我使用Laravel collective
我的输入语法:
{!! Form::number('credit_amount', '0.00', ['step' => '0.01', 'min' => '0.01', 'max' => '{{ $creditBalance }}', 'class' => 'text-center form-control']) !!}
我希望将$creditBalance放置在数字输入的"max"属性上。我可以做到这一点没有Laravel集体,但如何做到这一点与LC?谢谢!
Blade本质上只是将{!!
和!!}
分别替换为<?php echo
和?>
,因此您可以使用正常的PHP代码:
{!! Form::number('credit_amount', '0.00', ['min' => '0.01', 'max' => $creditBalance, 'class' => 'text-center form-control']) !!}