in reply to Template, sorting an array with only one member
$ cat sort-list.tt2 [% MACRO blocker BLOCK %] [% FOREACH element IN array.sort('name') %] [% element.name %] [%- END -%] [%- END -%] [%- SET array = [ { name => 'foo', value => 1 }, { name => 'bar', value => 2 }, { name => 'baz', value => 3 } ]; blocker %] [%- SET array = [ { name => 'bar', value => 2 }, ]; blocker %] $ tpage sort-list.tt2 bar baz foo bar
My code says it works ... so what does your code say?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Template, sorting an array with only one member (code not words)
by FloydATC (Deacon) on Oct 20, 2014 at 11:07 UTC | |
by Anonymous Monk on Oct 21, 2014 at 02:17 UTC | |
|
Re^2: Template, sorting an array with only one member
by Anonymous Monk on Oct 20, 2014 at 11:05 UTC |