PHPackages                             andrewdyer/view-presenters - 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. [Templating &amp; Views](/categories/templating)
4. /
5. andrewdyer/view-presenters

ActiveLibrary[Templating &amp; Views](/categories/templating)

andrewdyer/view-presenters
==========================

A clean, reusable solution for separating presentation logic from models and views in PHP applications

2.1.0(11mo ago)158MITPHPPHP ^8.3CI passing

Since Jun 5Pushed 11mo ago1 watchersCompare

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

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

View Presenters
===============

[](#view-presenters)

A clean, reusable solution for separating presentation logic from models and views in PHP applications.

⚖️ License
----------

[](#️-license)

Licensed under the [MIT license](https://opensource.org/licenses/MIT) and is free for private or commercial projects.

✨ Introduction
--------------

[](#-introduction)

When models or views become bloated with formatting and derived data logic, **View Presenters** offer a way to offload that responsibility into dedicated presenter classes. This improves separation of concerns, testability, and reusability.

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require andrewdyer/view-presenters
```

🚀 Getting Started
-----------------

[](#-getting-started)

### 1️⃣ Define a Presenter

[](#1️⃣-define-a-presenter)

Create a presenter class that extends `Presenter`:

```
