I am looking at switching to laravel for my next project.
我的下一个项目可能会是一个小网站,有几个静电页面,一个博客和一个项目经理,并且将使用控制器,而不是路由.
我好奇的是,我如何在拉维尔管理动态路由.
基本上,我想在一个管理部分,这样我就可以很容易地创建静电上的飞翔页面,静电页面将有搜索引擎优化重点的网址,例如http://domain.com/when-it-started我不想不得不创建一个新的控制器或手动 for each 页面路由.
所以我想知道最干净的处理方法是什么.
essentially all static pages are going to share the same view, just a few variables to change.
动态路由应该在控制器上工作,而不是在控制器上.
例如,如果我们有一个带有功能staff
的控制器about
,那么它应该通过http://domain.com/about/staff加载
but we dont have the function players
, so a call to http://domain.com/about/players should check the database to see if a dynamic route exists and matches. If it does display that, otherwise show the 404 page. Likewise for a non-existant controller. (e.g. there would not be a when-it-started
controller!)
Select 的答案在Laravel 4中似乎不起作用.有什么帮助吗?