我在 something.blade.php 中使用的代码是
{{ Form::text('fullname', isset(Input::old('fullname'))?Input::old('fullname'):$hello[1] }}
但我不确定为什么会返回以下错误
Can't use function return value in write context
一直在尝试 isset、trim、empty 但没有任何效果。 有什么问题?
最佳答案
你可以简单地使用这个
{{ Form::text('fullname', Input::old('fullname', $hello[1] ?: '' ) }}
Input::old()
采用默认值,可选。如果旧值可用,则将使用旧值而不是默认值。
关于php - laravel 中的 isset(Input::old ('abc'),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18839890/