Skip to content

.query() Array-Parameters won't fill PHP's $_GET as intended #28

Open
@Abromeit

Description

@Abromeit

Current Version

This Code:

.query({ foo: "bar", hello: ["world", "mars"] });

Leads to this:

// -> http://example.com/bar/foo.xml?foo=bar&hello=world&hello=mars

I think that's kinda senseless. Cause this is what we see on the Server-Side:

$_GET = array(
  'foo' => 'bar',
  'hello' => 'mars'
);

I.e. "hello=world" is missing and no one can work with it.

Improved Version

Better:

// -> http://example.com/bar/foo.xml?foo=bar&hello[]=world&hello[]=mars

Results in this:

$_GET = array(
  'foo' => 'bar',
  'hello' => array(
    0 => 'world',
    1 => 'mars'
  )
);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions