Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. InputBag.php

function InputBag::set

Sets an input by name.

Parameters

string|int|float|bool|array|null $value:

Overrides ParameterBag::set

1 call to InputBag::set()
InputBag::add in vendor/symfony/http-foundation/InputBag.php
Adds input values.

File

vendor/symfony/http-foundation/InputBag.php, line 68

Class

InputBag
InputBag is a container for user input values such as $_GET, $_POST, $_REQUEST, and $_COOKIE.

Namespace

Symfony\Component\HttpFoundation

Code

public function set(string $key, mixed $value) : void {
    if (null !== $value && !\is_scalar($value) && !\is_array($value) && !$value instanceof \Stringable) {
        throw new \InvalidArgumentException(\sprintf('Expected a scalar, or an array as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($value)));
    }
    $this->parameters[$key] = $value;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal