You are here

private function FormFieldRegistry::walk in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/FormFieldRegistry.php \Symfony\Component\DomCrawler\FormFieldRegistry::walk()

Transforms a PHP array in a list of fully qualified name / value.

Parameters

array $array The PHP array:

string $base The name of the base field:

array $output The initial values:

Return value

array The list of fields as array((string) Fully qualified name => (mixed) value)

1 call to FormFieldRegistry::walk()
FormFieldRegistry::all in vendor/symfony/dom-crawler/FormFieldRegistry.php
Returns the list of field with their value.

File

vendor/symfony/dom-crawler/FormFieldRegistry.php, line 178

Class

FormFieldRegistry
This is an internal class that must not be used directly.

Namespace

Symfony\Component\DomCrawler

Code

private function walk(array $array, $base = '', array &$output = array()) {
  foreach ($array as $k => $v) {
    $path = empty($base) ? $k : sprintf('%s[%s]', $base, $k);
    if (is_array($v)) {
      $this
        ->walk($v, $path, $output);
    }
    else {
      $output[$path] = $v;
    }
  }
  return $output;
}