My array "$groupData" looks like this:
array(3) (
0 => array(3) (
"id" => string(1) "2"
"name" => string(20) "Super Administrators"
"permissions" => array(3) (
"system" => integer 1
"superuser" => string(1) "1"
"admin" => string(1) "1"
)
)
1 => array(3) (
"id" => string(1) "3"
"name" => string(10) "Publishers"
"permissions" => array(4) (
"system.pub.add" => integer 1
"system.pub.delete" => integer 1
"system.pub.edit" => integer 1
"system.pub.publish" => integer 1
)
)
2 => array(3) (
"id" => string(1) "4"
"name" => string(7) "Authors"
"permissions" => array(3) (
"system.pub.add" => integer 1
"system.pub.delete" => integer 1
"system.pub.edit" => integer 1
)
)
)
I am having trouble rendering the permissions
part of my code. I have tried using {{#groupData}}{{#permissions}} {{.}} {{/permissions}}{{/groupData}}
but it doesn't work.
Your problem is that
{{ . }}
... You're trying to render an associative array as a string, and that just doesn't work in PHP:Like most things Mustache, the answer here is to prepare your view. What exactly would you expect it to render that array as? JSON? If so, make it explicit:
If you want it available as pairs of key/value, do that explicitly:
Do you just want to iterate over a list of the keys?