framework icon indicating copy to clipboard operation
framework copied to clipboard

[4.1.x] URL::action generator add parameters as query strings (?a&b&c) not as short url (a/b/c)

Open zaherg opened this issue 12 years ago • 7 comments

hey,

in version 4.0.x i used to code the URL::action like this :

URL::action('DataController@getIndex',array($domain, 'sowhat'));

and the output will be like data\sowhat

now in 4.1.x, the same code will generate : data?sowhat

i know am using a bad habit for Route::controller('data','DataController');

but is this the expected behavior from the URL::action ?

zaherg avatar Jan 02 '14 11:01 zaherg

i think this is just something related to the getIndex only cause others like getRecords, works fine .

zaherg avatar Jan 02 '14 13:01 zaherg

Maybe this has something to do with all the changing of route ordering that was done before 4.1 release? getIndex registers two routes:

GET /index/{v1}/{v2}/{v3}/{v4}/{v5}
GET /

If the URL generator hits the first route, the route params will work as intended, but if it hits the second all params will be query strings.

anlutro avatar Jan 03 '14 07:01 anlutro

@anlutro but as i know the Route::controller will make sure that it will hit the first route, before it goes to the second one right ?

zaherg avatar Jan 03 '14 09:01 zaherg

Im also facing this issue with the latest builds. It was working fine before.

tambijalouqa avatar Jan 07 '14 15:01 tambijalouqa

This has been fixed. Can you set your installation to minimum-stability: dev to pull in the changes and confirm.

taylorotwell avatar Jan 12 '14 06:01 taylorotwell

i can confirm that its fixed ..

thanks

zaherg avatar Jan 13 '14 07:01 zaherg

im using route controller and i wanted {{URL::action('SiteBrowsePackageController@getIndex',['category'=>'special'])}} query string instead /index/special .... any thought?

arisultima avatar Jan 13 '15 13:01 arisultima