SLLists – a PHP wrapper around scriptaculous sortables
So scriptaculous lists are really easy to use and implement…so why put together a PHP script to wrap around it all? I did this for a couple reasons (no the following list isn’t sortable!):
- It isn’t very obvious from scriptaculous (or other similar drag-and-drop sorting libraries) how sortables can actually be used in a real application
to perform a useful function.
- I wanted a simple way to serialize the result of all this snazzy ordering into a simple PHP array with which I could update a database
- PHP is fun.
- addList – adds a list or other element as a new sortable entity
- printForm – prints an HTML form that contains the hidden inputs needed. Alternatively users can create their own forms or use the printHiddenInputs functions to put these hidden inputs in existing forms
- getOrderArray – returns an array with items and their order after being passed an input with the serialzed scriptaculous list
For the full info, head to the SLLists page. The page has examples and shows what scriptaculous can do. And leave some comments here if you like it or have any comments…