Laravel 4刀片表单-如何包含HTML标记值?

Laravel 4刀片表单-如何包含HTML标记值?,html,laravel-4,blade,Html,Laravel 4,Blade,我正在尝试使用以下内容更新记录: {{Form::open(数组('action'=>array('RecZoneController@update“,[zoneid]))} 其中[zoneid]是当前选定的id为zone的select选项 我(显然)不熟悉这一点。我一直在兜圈子,似乎无法解决这个简单的问题。 谢谢您的帮助。这就是它的外观,例如 {{ Form::open(array('action' => 'SomeController@update')) }} {{ Form:

我正在尝试使用以下内容更新记录: {{Form::open(数组('action'=>array('RecZoneController@update“,[zoneid]))} 其中[zoneid]是当前选定的id为zone的select选项

我(显然)不熟悉这一点。我一直在兜圈子,似乎无法解决这个简单的问题。
谢谢您的帮助。

这就是它的外观,例如

{{ Form::open(array('action' => 'SomeController@update')) }}
    {{ Form::select('myselect', array(1 => 'True', 0 => 'False')) }}
{{ Form::close() }}
在控制器操作更新中

public function update() {
    $post = Input::get('myselect');
    // Do whatever you need to do with it...
}
你说的方式我相信是这样处理的

{{ Form::open(array('action' => array('SomeController@update', $user->id))) }}
    {{ Form::select('myselect', array(1 => 'True', 0 => 'False')) }}
{{ Form::close() }}
那么控制器会是这样的。。。我在工作,所以我不能测试它

// See how the argument passed to the method is the $user->id
public function update($userId) {
    $post = Input::get('myselect');
    // Do whatever you need to do with it... and $userId
}
但是在处理窗体视图的控制器操作中

public function createForm() {
    $user = User::all();
    View::make('myform', array('user' => $user));
}
另外,请确保为更新操作设置了如下路径

Route::post('/update/{userId}', 'SomeController@update');

您是否尝试过删除[zoneid],因为在这些文档中,它们实际上传递了一个变量。。。在行动中,从帖子中获取或获取请求!我的代码中没有[zoneid]——这是一个占位符,我无法理解——如何正确使用html标记的值来代替[zoneid]。这是一个普通的post表单,您不必手动将其传递给表单。Post也是默认设置,因此您也不必设置方法。只需在操作中获取$\u POST数据。如果没有完整的源代码,很难提供帮助