I am using jquery sortble to organize some slides. I am able to return an array of the id's in their new order but am struggling with how to iterate over these in the controller to update the sort order of the slides.
The array looks like this
[2016-06-25 02:09:53] local.INFO: array (
'order' =>
array (
0 => '2',
1 => '3',
2 => '1',
3 => '4',
4 => '5',
5 => '6',
6 => '7',
7 => '8',
8 => '9',
9 => '10',
10 => '11',
11 => '12',
12 => '13',
13 => '14',
14 => '15',
15 => '16',
16 => '17',
17 => '18',
18 => '19',
19 => '20',
20 => '21',
21 => '22',
),
)
So the id's of the slides are being returned in the new order, which is what I need, but now I need to do a foreach loop, or something, with that id number and update the sort order. Any help with how to grab each value in a foreach loop (or whatever the best way to achieve this may be) would be greatly appreciated.
from Newest questions tagged laravel-5 - Stack Overflow http://stackoverflow.com/questions/38024334/how-to-get-values-from-array-created-by-toarray
via IFTTT
Aucun commentaire:
Enregistrer un commentaire