PHPackages                             rawebone/view-model - 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. rawebone/view-model

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

rawebone/view-model
===================

This library provides an MVVM approach to view layers with am emphasis on testability and documentation

v0.1.0(12y ago)075PHPPHP &gt;=5.3.0

Since Jan 5Pushed 12y ago1 watchersCompare

[ Source](https://github.com/rawebone/ViewModel)[ Packagist](https://packagist.org/packages/rawebone/view-model)[ RSS](/packages/rawebone-view-model/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

ViewModel
=========

[](#viewmodel)

[![Build Status](https://camo.githubusercontent.com/b271636cd3a726aa1c77e065e34826add0ce6f8c4b2095a2e9c8464a94079e24/68747470733a2f2f7472617669732d63692e6f72672f72617765626f6e652f566965774d6f64656c2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/rawebone/ViewModel)

View Models provide an abstraction between Models, structures holding data in your Domain Layer, and Views, the interpolation of data into a User Interface. This abstraction exists to reduce the amount of logic required to markup the UI and to enable testing of the core presentation logic without having to compare the entire output markup. In addition, should your template system change the logic should be very simplistic to migrate.

This library provides:

- A basic implementation of the MVVM pattern
- Adapters for a number of Templating Engines
- A system for documenting View Models so that the information can be passed on to designers/product managers

Usage
-----

[](#usage)

### View Models

[](#view-models)

A View Model consists of a class, defining the logic, and a template defining the markup of the output:

```
