TwigLiveComponent - dynamically url path #2172
Answered
by
smnandre
disceney
asked this question in
Questions & Answers
-
Hello, I would like to know if it is possible to dynamically modify the rendering URLs with TwigLiveComponent. For example, here is a component: <?php
declare(strict_types=1);
namespace App\Twig\Components\User;
...
#[AsLiveComponent]
final class Notification
{ And its usage in a Twig template: <twig:User:Notification user="{{ app.user }}"/> When called, here is the URL generated in the network tab of the console:
Is there a way, either globally or not, to generate custom URLs? For example, to obtain a URL in the following form:
Thank you for your help |
Beta Was this translation helpful? Give feedback.
Answered by
smnandre
Sep 17, 2024
Replies: 1 comment
-
You can either globally (change the route declared in config/routes/live_component.yaml) or per component |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
disceney
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can either globally (change the route declared in config/routes/live_component.yaml) or per component
(see https://symfony.com/bundles/ux-live-component/current/index.html#define-another-route-for-your-component )