- What is ibexa/templated-uri-bundle used for?
- It is a Symfony bundle that adds an RFC-6570 compatible router and URL generator. It exposes the hautelook.router.template service so you can generate templated links such as /demo?{&page}{&sort*}{&filter*} from route parameters. It is useful for APIs, HATEOAS links, filtering, pagination, and legacy URL migration.
- Does ibexa/templated-uri-bundle work with Laravel?
- No, it is a Symfony bundle and does not provide a Laravel service provider, facade, or router integration. Laravel applications do not register Symfony bundles the same way, so installing it with Composer will not make templated routing work out of the box. Laravel teams should evaluate the underlying hautelook/TemplatedUriRouter library or a Laravel-native RFC-6570 implementation instead.
- How do I install ibexa/templated-uri-bundle?
- Run composer require ibexa/templated-uri-bundle. In a Symfony app, register Hautelook\TemplatedUriBundle\HautelookTemplatedUriBundle in AppKernel.php or let Symfony Flex add it to bundles.php. Then use the hautelook.router.template service. Laravel has no equivalent bundle registration step.
- Which Symfony versions does ibexa/templated-uri-bundle support?
- The package context indicates support for Symfony 3 through 6, including Flex. Because it is a fork of hautelook/templated-uri-bundle, you should pin symfony/* dependencies and verify compatibility for your exact Symfony version before production use. The original package's support range may differ from the fork's.
- How do I generate an RFC-6570 URI template with this bundle?
- Get the hautelook.router.template service and call generate with a route name and parameters that contain template expressions. For example, passing page as {page}, sort as an array containing {sort}, and filter as an array containing {filter} can produce /demo?{&page}{&sort*}{&filter*}. Validate the resulting template because malformed braces or invalid expansion patterns can break clients.
- What is the difference between ibexa/templated-uri-bundle and hautelook/templated-uri-bundle?
- ibexa/templated-uri-bundle is a fork of hautelook/templated-uri-bundle. Both wrap the hautelook/TemplatedUriRouter library and expose a Symfony bundle for RFC-6570 templated routing. The fork may lag behind the original in maintenance or Symfony version support, so compare release history and pin dependencies carefully.
- Can I use it alongside Symfony's default router?
- Yes, the bundle is designed to extend rather than replace Symfony's native router. Existing routes can keep using Symfony's normal URL generation while templated routes use the hautelook.router.template service. This makes a hybrid routing strategy feasible when only some endpoints need RFC-6570 templates.
- Is ibexa/templated-uri-bundle safe for production APIs?
- It can be suitable for production APIs that need RFC-6570 template generation, but the evaluation notes a lack of tests and potential Symfony version drift. Validate templates at runtime, sanitize dynamic variables, and benchmark against Symfony's native router for high-traffic endpoints. Add your own test coverage before relying on it for critical APIs.
- How do I test templated URI generation with this bundle?
- The package itself is noted as having testing gaps, so you should add integration tests around the hautelook.router.template service. Cover valid templates, malformed braces, reserved characters, missing parameters, and injection-style values. Property-based or table-driven tests are useful for checking RFC-6570 expansion edge cases.
- What are alternatives to ibexa/templated-uri-bundle for RFC-6570 URLs?
- Symfony's built-in router handles static routes but does not natively support RFC-6570 expansions like {&query} or {+segment}. You can use the underlying hautelook/TemplatedUriRouter library directly, implement template expansion in application code, or choose a Laravel-native URI template library if you are not on Symfony. Evaluate maintenance, test coverage, and framework integration before choosing.