Webiny\Component\Http\Request\Query::get PHP Метод

get() публичный Метод

Get the value from GET for the given $key.
public get ( string $key, null $value = null ) : string
$key string Key name.
$value null Default value that will be returned if the $key is not found.
Результат string Value under the defined $key.
    public function get($key, $value = null)
    {
        return $this->queryBag->key($key, $value, true);
    }

Usage Example

Пример #1
0
 public function testGet()
 {
     $_GET = ["name" => "jack"];
     $query = new Query();
     $this->assertSame("jack", $query->get("name"));
     $this->assertNull($query->get("NON_EXISTING"));
     $this->assertSame("doe", $query->get("NON_EXISTING_2", "doe"));
 }
All Usage Examples Of Webiny\Component\Http\Request\Query::get