我有ReportController 仅作为 POST 路由的索引
public function index() // must have start, end, client
{
$start = Input::get('start'); // <<< This are POST variables
$end = Input::get('end'); // <<< This are POST variables
$client = Input::get('client'); This are POST variables
db request... output view..
}
当我点击“删除行”时,它会将信息发布到
public function deleteRow()
{
db request -> delete();
//How do I go back to index controller and pass same $_POST['start'],$_POST['end'],$_POST['client']
}
如何返回索引 Controller 并传递相同的 $_POST['start']、$_POST['end']、$_POST['client']?
最佳答案
您也许可以使用Redirect::to('url')->withInput()
然后你可以使用Input::get('key')
如果这不起作用,请尝试 Input::old('key')
-> 不太漂亮
关于Laravel:重定向到另一个需要 POST 变量的 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19040099/