【问题标题】:use old helper in nestead inputs在嵌套输入中使用旧助手
【发布时间】:2020-07-29 06:37:53
【问题描述】:

我正在使用 laravel,我有这样的输入

<input value="{{ old('group[1][p_id]') }}" type="text" class="form-control inputfield min-width-140" name="group[1][p_id]" placeholder=" 30">

但每当我想使用旧助手时,它都不能正常工作

在这种情况下我该如何使用旧助手?

【问题讨论】:

  • 尝试使用group.1.p_idgroup.0.p_id 而不是group[1][p_id]

标签: php laravel helper


【解决方案1】:

对于名称为 group[1][p_id] 的字段,请使用 old('group.1.p_id')

p_id 是动态字段并且您的输入字段名称类似于group[1][3] 时,您可以使用旧的,例如old('group.1.' . $p_id)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-16
    • 2021-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多