donxbje866688 2014-03-21 13:07
浏览 122
已采纳

在Laravel 4中找不到控制器方法

Hi am having some sort of an issue, I created a controller and have registered it in my routes but the I keep getting an error when I try browsing to its page. The default show, create, destroy and update methods still work but the ones I create don't work I wish I knew what I am doing wrong.

The Error:

`Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
Controller method not found.`

My Route:

Route::Resource("impactnetwork","impactController");

Route::get("impactnetwork/itinerary","impactController@itinerary");

Route::get("impactnetwork/gallery","impactController@gallery");

Route::get("impactnetwork/lead","impactController@lead");

My Controller:

`public function itinerary()
 {

return View::make("pages/impactitinerary");
 }

 public function gallery()
 {

return View::make("pages/impactgallery");
 }

 public function lead()
 {

return View::make("pages/impactlead");
 }
`

I try to brwose:

www.mysite.dev/impactnetwork/itinerary

www.mysite.dev/impactnetwork/gallery

www.mysite.dev/impactnetwork/lead

But it keeps saying "Controller method not found"

  • 写回答

1条回答 默认 最新

  • dtwxmn8741 2014-03-21 13:11
    关注
    Route::resource("impactnetwork","impactController");
    

    This defines your controller as a Resourceful controller, which have limited amount of actions.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化