Skip to content

Commit 0839ba6

Browse files
authored
Fix EvolvableLink attribute
1 parent 7d714b1 commit 0839ba6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

web_link.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ You can also add links to the HTTP response directly from controllers and servic
166166
public function index(Request $request)
167167
{
168168
$linkProvider = $request->attributes->get('_links', new GenericLinkProvider());
169-
$request->attributes->set('_links', $linkProvider->withLink(new Link('preload', '/app.css', ['as' : 'style'])));
169+
$request->attributes->set(
170+
'_links',
171+
$linkProvider->withLink(
172+
(new Link('preload', '/app.css'))->withAttribute('as', 'style')
173+
)
174+
);
170175

171176
return $this->render('...');
172177
}

0 commit comments

Comments
 (0)