You are here

public function AcceptHeaderItem::setAttribute in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/AcceptHeaderItem.php \Symfony\Component\HttpFoundation\AcceptHeaderItem::setAttribute()

Set an attribute.

Parameters

string $name:

string $value:

Return value

AcceptHeaderItem

1 call to AcceptHeaderItem::setAttribute()
AcceptHeaderItem::__construct in vendor/symfony/http-foundation/AcceptHeaderItem.php
Constructor.

File

vendor/symfony/http-foundation/AcceptHeaderItem.php, line 216

Class

AcceptHeaderItem
Represents an Accept-* header item.

Namespace

Symfony\Component\HttpFoundation

Code

public function setAttribute($name, $value) {
  if ('q' === $name) {
    $this->quality = (double) $value;
  }
  else {
    $this->attributes[$name] = (string) $value;
  }
  return $this;
}