【发布时间】:2014-06-08 14:24:35
【问题描述】:
我有三个网址:
localhost:8000/oc/online-marketing/ppc
localhost:8000/websystems/online-marketing/ppc
localhost:8000/all/online-marketing/ppc
我需要为每个 URL 进行动态设置。
在此之前,我曾经有过这样的route.php:
Route::get('oc/online-marketing/ppc', function()
{
$users = User::where('client_id', 1)->get();
return View::make('users')->with('users', $users);
});
但我必须像这样设置动态网址:Route::get('{project}/{module}/{submodule}', ... );
其中project 是oc 或websystems 或全部
module 是 online-marketing
submodule 是 ppc
项目名称oc、websystems或all可以在名为users的表中
如何使用控制器来实现这一点?
【问题讨论】:
标签: url laravel laravel-routing