leafsphp / router

🏚 router module for leaf PHP
https://leafphp.dev/modules/router/
6 stars 6 forks source link

Get routes by name with parameters #13

Closed zahovicS closed 1 month ago

zahovicS commented 8 months ago

This appears in the documentation:

app()->get('/movies/{movieId}', ['name' => 'movies', function () {
  echo 'User Movies';
}]);

app()->route('movies', 'my-movie') // Would return: /movies/my-movie

But when I use it:

app()->route('movies', 'my-movie') // Return: /movies/{movieId}

Returns the path, does not replace it with the entered value.

I am doing something wrong? I am using Leaf MVC

mychidarko commented 2 months ago

I believe this was fixed in a recent PR

zahovicS commented 1 month ago

Thanks