Skip to content
Permalink
Browse files

Add FormData::addMany()

This makes integration with the client simpler.
  • Loading branch information...
markstory committed Dec 23, 2012
1 parent ac82ae3 commit 80d1b3220521666e7d8d5a9be3497d740d58fa36
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/Cake/Network/Http/FormData.php
@@ -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.

0 comments on commit 80d1b32

Please sign in to comment.
You can’t perform that action at this time.