在laravel中,我们可以通过Input::get('inputname')获取输入值.我尝试通过执行此操作来更改值 Input::get('inputname') = "new value";.但是,我收到错误消息说Can't use function return value in write context.
In laravel, we can get the input value via Input::get('inputname'). I try to change the value by doing this Input::get('inputname') = "new value";. But then, I get the error message saying Can't use function return value in write context.
我们是否可以更改输入值,以便稍后调用 Input::get('inputname') 时将获得新的修改值?
Is it possible for us change the input value so that when later calling on Input::get('inputname') will get the new amended value?
谢谢.
您可以使用 Input::merge() 替换单个项目.
You can use Input::merge() to replace single items.
Input::merge(['inputname' => 'new value']);
或者使用Input::replace()替换整个输入数组.
Or use Input::replace() to replace the entire input array.
Input::replace(['inputname' => 'new value']);
这是一个文档链接
这篇关于Laravel 更改输入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Zend 中的动作视图助手 - 解决方法?Action View Helper in Zend - Work around?(Zend 中的动作视图助手 - 解决方法?)
这是将 URI 与 PHP 中用于 MVC 的类/方法匹配的好方Is this a good way to match URI to class/method in PHP for MVC(这是将 URI 与 PHP 中用于 MVC 的类/方法匹配的好方法吗)
我在哪里保存 Zend Framework 中的部分(视图),以便Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?(我在哪里保存 Zend Framework 中的部分(视图),以
有一个网站的单一入口点.坏的?好的?没问题?Having a single entry point to a website. Bad? Good? Non-issue?(有一个网站的单一入口点.坏的?好的?没问题?)
MVC + 服务层在 Zend 或 PHP 中常见吗?Is MVC + Service Layer common in zend or PHP?(MVC + 服务层在 Zend 或 PHP 中常见吗?)
PHP MVC 方法中的 Hello World 示例Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)