4 ms·
I'll raise you my bleeding edge dsl: echo $conn->execute('select * from favcolor order by color, name') ->groupBy(L(val)->color) ->ma
by shaunxcode 16y ago
I'll raise you my bleeding edge dsl:
echo $conn->execute('select * from favcolor order by color, name')
->groupBy(L(val)->color)
->map(L(key)->wrap('<li><b>', '</b>')
->append(
': ',
L(val)->map(L(val)->name)->join(','),
'</li>'))
->join("\n");
- wvenable 16y agoNice. I've done something similar myself but I didn't take it exactly in the same direction. I leave much of grouping, wrapping, appending work to my own template engine layer. Is the source to your DSL available?
- shaunxcode 16y agoYeah I would normally never mix the templating/html w/ the data processing but I was trying to stick to the example but w/ one line hah. Right now it is part of my new web framework which is very much a work in progress but available on http://voltron.googlecode.com http://voltron.googlecode.com the relevant code for the Array dsl is under Model/Type/Array.php and FluentLambda.php and the constant declarations are in bootstrap.php - again total work in progress so things are not as clean as they should be just yet. Also http://commonphp.blogspot.com http://commonphp.blogspot.com is where I write about it.