From 0839ba6bb949a1cf5c3c783c2b66d0516ea35519 Mon Sep 17 00:00:00 2001 From: Beno!t POLASZEK Date: Tue, 15 Oct 2019 18:54:40 +0200 Subject: [PATCH] Fix EvolvableLink attribute --- web_link.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web_link.rst b/web_link.rst index fd13492add5..b50316d79e8 100644 --- a/web_link.rst +++ b/web_link.rst @@ -166,7 +166,12 @@ You can also add links to the HTTP response directly from controllers and servic public function index(Request $request) { $linkProvider = $request->attributes->get('_links', new GenericLinkProvider()); - $request->attributes->set('_links', $linkProvider->withLink(new Link('preload', '/app.css', ['as' : 'style']))); + $request->attributes->set( + '_links', + $linkProvider->withLink( + (new Link('preload', '/app.css'))->withAttribute('as', 'style') + ) + ); return $this->render('...'); }