Skip to content

Commit

Permalink
Add FormData::addMany()
Browse files Browse the repository at this point in the history
This makes integration with the client simpler.
  • Loading branch information
markstory committed Dec 23, 2012
1 parent ac82ae3 commit 80d1b32
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/Cake/Network/Http/FormData.php
Expand Up @@ -89,6 +89,20 @@ public function add($name, $value) {
return $this;
}

/**
* Add multiple parts at once.
*
* Iterates the parameter and adds all the key/values.
* @param array $data Array of data to add.
* @return FormData $this
*/
public function addMany(array $data) {
foreach ($data as $name => $value) {
$this->add($name, $value);
}
return $this;
}

/**
* Add either a file reference (string starting with @)
* or a file handle.
Expand Down

0 comments on commit 80d1b32

Please sign in to comment.