Skip to content

Commit 9ae16ac

Browse files
committed
Docs tweaks
1 parent bbc1bf0 commit 9ae16ac

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

docs/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
- [Introduction](/open-source/packages/laravel-server-push-manager/docs/1.x/intro)
2-
- [Installation & Setup](/open-source/packages/laravel-server-push-manager/docs/1.x/installation)
3-
- [Usage](/open-source/packages/laravel-server-push-manager/docs/1.x/usage)
1+
- [Introduction](/open-source/packages/laravel-server-push-manager/docs/2.x/intro)
2+
- [Installation & Setup](/open-source/packages/laravel-server-push-manager/docs/2.x/installation)
3+
- [Usage](/open-source/packages/laravel-server-push-manager/docs/2.x/usage)

docs/usage.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Usage
22

3-
## Supported Relations
3+
## Primary Usage
4+
5+
The `BabDev\ServerPushManager\Contracts\PushManager::link()` method is the main method for adding a link with any set of relations and/or attributes which will be converted into an appropriate HTTP/2 `Link` response header value.
6+
7+
The method accepts three parameters:
8+
9+
- `$uri` - The URI for the resource
10+
- `$rel` - The relations for this resource, this may be either a single string or an array of strings to specify multiple relations
11+
- `$attributes` - An optional array of additional attributes for the resource, these are passed to the `Psr\Link\EvolvableLinkInterface::withAttribute()` method and the values should follow the specification's requirements
12+
13+
Note that this method returns the `$uri` passed into it, this allows you to wrap other function calls within calls to the manager (see below for an example).
14+
15+
## Helper Methods
416

517
The `BabDev\ServerPushManager\Contracts\PushManager` interface defines several helper methods for adding resources to a HTTP/2 `Link` response header with the appropriate relations, including:
618

@@ -13,7 +25,7 @@ The `BabDev\ServerPushManager\Contracts\PushManager` interface defines several h
1325
Each of these methods accepts two parameters:
1426

1527
- `$uri` - The URI for the resource
16-
- `$attributes` - An optional array of additional attributes for the resource
28+
- `$attributes` - An optional array of additional attributes for the resource, these are passed to the `Psr\Link\EvolvableLinkInterface::withAttribute()` method and the values should follow the specification's requirements
1729

1830
Note that each of these methods returns the `$uri` passed into the method, this allows you to wrap other function calls within calls to the manager (see below for an example).
1931

0 commit comments

Comments
 (0)