欢迎各位兄弟 发布技术文章
这里的技术是共享的
例子:
$u = URL::action('SpielController@getIndex', array(
'term' => 'termb',
'link' => 'type'
));
var_dump($u);
> string 'http://zrw2014vorsorge.dev/spiel/index/termb/type' (length=49)
我需要:string 'http://zrw2014vorsorge.dev/spiel/index?term=termb&link=type'
Route::get('spiel', array('as' => 'spiel.index', 'uses' => 'SpielController@getIndex'));
//then
$u = URL::route('spiel.index', array(
'term' => 'termb',
'link' => 'type'
));
$params = array('term' => 'termb', 'link' => 'type');
$queryString = http_build_query($params);
$u = URL::to(action('SpielController@getIndex') . '?' . $queryString);
$params = array('term' => 'termb', 'link' => 'type');
$queryString = http_build_query($params);
URL::action('ProfileController@show', '?'.$queryString )