PHPackages                             phoneburner/link-tortilla - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. phoneburner/link-tortilla

ActiveLibrary[HTTP &amp; Networking](/categories/http)

phoneburner/link-tortilla
=========================

Provides a simple set of traits to allow wrapping user classes as PSR-13 Link implementations.

v1.0.1(5mo ago)01.4k24MITPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Jul 30Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/phoneburner/link-tortilla)[ Packagist](https://packagist.org/packages/phoneburner/link-tortilla)[ RSS](/packages/phoneburner-link-tortilla/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (10)Versions (3)Used By (4)

Link Tortilla - PSR-13 Hypermedia Links Wrapper
===============================================

[](#link-tortilla---psr-13-hypermedia-links-wrapper)

Provides a simple set of traits to allow wrapping user classes as \[PSR-13 Link\] () implementations. Wrapping the class allows easy addition of convenience methods, while maintaining compatibility with code that relies on the underlying PSR interfaces.

For convenience, this project also includes `\PhoneBurner\LinkTortilla\Link`, a simple implementation of the PSR-13 `Psr\Link\EvolvableLinkInterface` that can be used as the instance passed into the wrapper class.

Installation
------------

[](#installation)

The preferred method of installation is to use [Composer](https://getcomposer.org/):

```
composer require phoneburner/link-tortilla
```

This library currently requires PHP &gt;= 8.2 and [`psr/link`](https://github.com/php-fig/link) ^2.0.

Usage
-----

[](#usage)

To add PSR-13 Link behavior to an arbitrary object, add the `LinkWrapper` trait, and set the wrapped Link with `setWrapped()`. Now if you add "implements Psr\\Link\\EvolvableLinkInterface" to the class definition, you will see that all the required methods are defined and proxy to the wrapped Link.

```
