Support the ongoing development of Laravel.io →
posted 10 years ago
Views
Last updated 2 years ago.
0

.../export/?id <--- this is a bit prustating putting a quest-mark directly after slash

if you are using pagination, you can just add

$yourData->appends(array('sort' => 'votes'))->links();

this will generate link : http://example.com/something?page=2&sort=votes

Last updated 2 years ago.
0

2codetrash

Append works with the pagination links, I'm interested in appending the query parameters to the route. How can I do this?

update

However, it turned out, that if I declare the controller's action explicitly, then the URL::route works fine:

Route::get('datacatalogue/export', array('as' => 'datacatalogue.export', 'uses' => 'DatacatalogueController@getExport'));

// and

URL::route('datacatalogue.export', array('id'=>1))

returns http://mydomain.com/datacatalogue/export?id=1

Last updated 2 years ago.
0

That's nice

what about this kind of url :

/export/?id      //quest-mark is put right after a slash  ? like http://mydomain.com/datacatalogue/export/?id=1&another_param=2 

I found this wont work.

Last updated 2 years ago.
0

The working or not working of export/? or just ? depends on your routes setup.

Last updated 2 years ago.
0

Putting '?' directly after url slash '/' wont work....

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.