diff --git a/README.md b/README.md index f26edc0..4cd383c 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,19 @@ class GetPhotoEdit // parent: GetPhoto GET /photo/1/edit +> **Tip:** +> +> For a URL with a parameter in the middle (like `/photo/1/edit`), +> AutoRoute needs to be able to determine that `1` is a parameter +> and not a namespace segment. It does this by checking if a parent +> class exists that handles the same path without the tail segment. +> +> In this example, `Project\Http\Photo\GetPhoto` with the `int $photoId` +> parameter must exist for `Project\Http\Photo\Edit\GetPhotoEdit` +> to work correctly. This allows the router to understand that in +> `/photo/1/edit`, the `1` corresponds to the `$photoId` parameter +> and `edit` is a static path segment. + Finally, a request for the root URL ... GET /