Skip to content

Routing issue - bad args in function call. #672

Description

@nowackipawel

I defined routing like this:

$routes->get('/objects/(:Dalphanum)/sort/(:Dalphanum)/([A-Z]{3,7})', 'AdminList::objectsSortCreate/$1/$2/$3', ['subdomain' => 'adm']);

where Dalphanum is:
$routes->addPlaceholder('Dalphanum', '([0-9a-zA-Z_\-\.]+)');

And
var_dump(func_get_args());

which is inside objectsSortCreate method prints:

array(3) { [0]=> string(6) "someth" [1]=> string(6) "someth" [2]=> string(3) "FOO" }

when I'm trying to open:

https://adm.dmvoneway.com/objects/someth/sort/FOO/BAR

when I changed route for:

$routes->get('/objects/(:Dalphanum)/sort/(:Dalphanum)/([A-Z]{3,7})', 'AdminList::objectsSortCreate/$1/$2/$3/$4/$5', ['subdomain' => 'adm']);

var_dump prints:

array(5) { [0]=> string(6) "someth" [1]=> string(6) "someth" [2]=> string(3) "FOO" [3]=> string(3) "FOO" [4]=> string(3) "BAR" }

I'm not sure if should be:

[0] => someth
[1] => sort
[2] => FOO
[3] => BAR

instead of returning value.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions