File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -1335,23 +1335,12 @@ Currently, Live Components do not natively support returning file responses dire
13351335
13361336Create a LiveAction that generates the URL for the file download and returns a `RedirectResponse `::
13371337
1338- use Symfony\Component\HttpFoundation\RedirectResponse;
1339- use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1340- use Symfony\UX\LiveComponent\Attribute\LiveAction;
1341-
1342- // ...
1343-
1344- class MyDownloadButton
1345- {
1346- // ...
1347-
13481338 #[LiveAction]
13491339 public function initiateDownload(UrlGeneratorInterface $urlGenerator): RedirectResponse
13501340 {
13511341 $url = $urlGenerator->generate('app_file_download');
13521342 return new RedirectResponse($url);
13531343 }
1354- }
13551344
13561345.. code-block :: html+twig
13571346
@@ -3802,7 +3791,7 @@ uses Symfony's test client to render and make requests to your components::
38023791 // authenticate a user ($user is instance of UserInterface)
38033792 $testComponent->actingAs($user);
38043793
3805- // set the '_locale' route parameter (if the component route is localized)
3794+ // set the '_locale' route parameter (if the component route is localized)
38063795 $testComponent->setRouteLocale('fr');
38073796
38083797 // customize the test client
You can’t perform that action at this time.
0 commit comments