Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing: setArgument() is not taking arrays any more #3005

Closed
snoopy72 opened this issue Oct 3, 2020 · 1 comment
Closed

Routing: setArgument() is not taking arrays any more #3005

snoopy72 opened this issue Oct 3, 2020 · 1 comment

Comments

@snoopy72
Copy link

snoopy72 commented Oct 3, 2020

Hello,

upgrading from V3 to V4 we suddenly receive this error message:

Argument 2 passed to Slim\\Routing\\Route::setArgument() must be of the type string, array given, called in ...

Example (only for showing the system; namespaces and values renamed for public presentation):

$app->group("/demo", function(RouteCollectorProxy $grp) {
    $grp->post("/test/{token}", "App\TestController:test")
        ->setArgument("param1", false)
        ->setArgument("param2", array("value1" => "N", "value2 => 15, ...))
        ->setName("test1");
});

That's "a bit" annoying for us, because we pass arrays as parameters to the route very successfully in our running slim app.

A quick change is not the best option: Our App contains several thousand routes and more files. We currently give service to also several 1000 customers with our app and are not is the position to "quickly" rebuild the whole routing.

Any idea or solution ?

@l0gicgate
Copy link
Member

Use setArguments()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants