-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Current implementation always return an array of key/value. The following code:
$companies = $pages->find("template=company, parent=/companies/, limit=10")->explode([
"title",
"contact.person",
"contact.email",
"address.city",
"address.state",
"address.zip"
]);
will return this array for each item:
0 => [
'title' => 'ProcessWire, Inc.'
'contact.person' => 'John Doe'
'contact.email' => '[email protected]'
'address.city' => 'Melbourne Beach'
'address.state' => 'FL'
'address.zip' => '32951'
]
otherwise if I use the following:
$companies = $pages->find("template=company, parent=/companies/, limit=10")->explode([
"title",
"contact[]",
"address[]"
]);
I will get the whole WireArray for contact and address field like:
0 => [
'title' => 'ProcessWire, Inc.'
'contact[]' => WireArray
'address[]' => WireArray
]
The feature that I propose is to allow this:
$companies = $pages->find("template=company, parent=/companies/, limit=10")->explode([
"title",
"contact[person, email]",
"address[city, state, zip]"
]);
with a return array like:
0 => [
'title' => 'ProcessWire, Inc.'
'contact' => [
'person' => 'John Doe',
'email' => '[email protected]'
],
'address' => [
'city' => 'Melbourne Beach',
'state' => 'FL',
'zip' => '32951'
]
]
Metadata
Metadata
Assignees
Labels
No labels