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