You are here

public function Client::addPostFields in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/fabpot/goutte/Goutte/Client.php \Goutte\Client::addPostFields()
1 call to Client::addPostFields()
Client::doRequest in vendor/fabpot/goutte/Goutte/Client.php

File

vendor/fabpot/goutte/Goutte/Client.php, line 186

Class

Client
Client.

Namespace

Goutte

Code

public function addPostFields(array $formParams, array &$multipart, $arrayName = '') {
  foreach ($formParams as $name => $value) {
    if (!empty($arrayName)) {
      $name = $arrayName . '[' . $name . ']';
    }
    if (is_array($value)) {
      $this
        ->addPostFields($value, $multipart, $name);
    }
    else {
      $multipart[] = [
        'name' => $name,
        'contents' => $value,
      ];
    }
  }
}