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

[BUG]: Router parts cannot be unset, if matches parts are optional #16559

Open
kenyeung826 opened this issue Apr 2, 2024 · 0 comments
Open
Labels
bug A bug report status: unverified Unverified

Comments

@kenyeung826
Copy link

Describe the bug
A clear and concise description of what the bug is.
Router parts cannot be unset, if matches parts are optional

To Reproduce
The Annotation Route Prefix

/**
 * @RoutePrefix('/soundcolumn')
 */

The Annotation Route Method with 2 optional parts

/**
* @Get('{id:(/[0-9]+)?}{slug:(/.+)?}')
*/

When request with /soundcolumn, assume the id and slug are unset.
The following is the result from $router->getParams()

(
    [namespace] => App\Controller
    [controller] => sound_column
    [action] => show
    [id] => 1
    [slug] => 2
)

Expected behavior
When request with /soundcolumn, assume the id and slug are unset

Details

  • Phalcon version: 5.6.0
  • PHP Version: 8.3.3
  • Operating System: Linux Rocky 9 (5.14.0-362.18.1.el9_3.x86_64)
  • Installation type: install through remi-repo
  • Zephir version (if any):
  • Server: Nginx
  • Other related info (Database, table schema): MySQL 5.6.36
@kenyeung826 kenyeung826 added bug A bug report status: unverified Unverified labels Apr 2, 2024
@kenyeung826 kenyeung826 reopened this Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: unverified Unverified
Projects
None yet
Development

No branches or pull requests

1 participant