예제 #1
0
 /**
  * Get a specific field from a header like content type or all fields as array
  *
  * If the header occurs more than once, only the value from the first header
  * is returned.
  *
  * Throws an Exception if the requested header does not exist. If
  * the specific header field does not exist, returns null.
  *
  * @param  string $name       name of header, like in getHeader()
  * @param  string $wantedPart the wanted part, default is first, if null an array with all parts is returned
  * @param  string $firstName  key name for the first part
  * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value)
  * @throws \Zend\Mime\Exception\RuntimeException
  */
 public function getHeaderField($name, $wantedPart = '0', $firstName = '0')
 {
     return Mime\Decode::splitHeaderField(current($this->getHeader($name, 'array')), $wantedPart, $firstName);
 }