[英]Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException Laravel 4.1
SOLVED!! 解决了!! Just add
只需添加
HomeController 家庭控制器
public function whereDidYouSeePost() {
return View::make("WDS");
}
and Route 和路线
Route::post("whereDidYouSee", array(
"as" => "whereDidYouSee",
"uses" => "HomeController@whereDidYouSeePost"
));
I am trying to post a form but everytime getting this error: 我正在尝试发布表单,但是每次都会收到此错误:
Symfony\Component\HttpKernel\Exception\NotFoundHttpException
But when I change the root and copy the form on my home file (I mean ../public) everything works great. 但是,当我更改根目录并将其复制到我的主文件中(我是说../public)时,一切正常。 What am I suppose to do?
我应该怎么办?
Thank you. 谢谢。
Here are my codes 这是我的代码
HomeController 家庭控制器
public function whereDidYouSee() {
return View::make("WDS");
}
Routes 路线
Route::get("whereDidYouSee", array(
"as" => "whereDidYouSee",
"uses" => "HomeController@whereDidYouSee"
));
Form 形成
{{ Form::open(array("action" => "HomeController@WDS", "url" => "whereDidYouSee" )) }}
//bla bla bla
{{ Form::close() }}
That is because your form URL is relative, generate it based on the route name like: 这是因为您的表单URL是相对的,请根据如下路径名称生成它:
{{ Form::open(array('route' => 'whereDidYouSee')) }}
//bla bla bla
{{ Form::close() }}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.