gpt4 book ai didi

Laravel 4 : difference between resource and controller in Route class

转载 作者:行者123 更新时间:2023-12-04 14:27:53 32 4
gpt4 key购买 nike

静态路由方法“资源”和“ Controller ”有什么区别

Route::controller()


Route::resource()

谢谢,

最佳答案

我得到了一些东西:

Route::resource()
  • 强制您使用默认方法(索引、创建、存储、显示、编辑、更新、销毁)而无法在 Controller 类中添加新方法(无法调用新方法)


  • Route::controller()
  • 让你在 Controller 类中定义无限的方法
  • 需要在函数名称前定义使用的 HTTP 动词,如 (postCreate, anyCreate)
  • 关于Laravel 4 : difference between resource and controller in Route class,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24179110/

    32 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com