PHPackages                             wickedbyte/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. wickedbyte/link-tortilla

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

wickedbyte/link-tortilla
========================

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

v3.0.0(3mo ago)00MITPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Jul 30Pushed 3mo agoCompare

[ Source](https://github.com/wickedbyte/link-tortilla)[ Packagist](https://packagist.org/packages/wickedbyte/link-tortilla)[ Docs](https://github.com/wickedbyte/link-tortilla)[ RSS](/packages/wickedbyte-link-tortilla/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (10)Versions (4)Used By (0)

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

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

> This project is an independently maintained fork of [phoneburner/link-tortilla](https://github.com/phoneburner/link-tortilla), originally released under the MIT license, by the original project authors. This fork is neither affiliated with nor endorsed by PhoneBurner.

Provides a simple set of traits to allow wrapping user classes as [PSR-13 Link](https://www.php-fig.org/psr/psr-13/)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 `\WickedByte\LinkTortilla\Link`, a simple implementation of the PSR-13 `Psr\Link\EvolvableLinkInterface` that can be used as the instance passed into the wrapper class.

Requirements
------------

[](#requirements)

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

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

[](#installation)

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

```
composer require wickedbyte/link-tortilla
```

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.

```
