// Define a route with a name $app->get('/users/{id}', function ($request, $response, $args) { // Display user details for ID $args['id'] })->setName('user-details'); // Generate a URL for the user-details route $url = $app->urlFor('user-details', ['id' => 1]); // The URL will be: /users/1In this example, we define a route that takes an `id` parameter and generates a user details view. We then give the route a name using the `setName` method. Finally, we generate a URL for this route using `urlFor` and a placeholder value of `1` for the `id` parameter. The `urlFor` method is part of the Slim package and can be found in the `Slim\App` class.