PHPackages                             programster/abstract-view - 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. programster/abstract-view

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

programster/abstract-view
=========================

An abstract view to make views easy.

1.1.1(1y ago)02.7k↓22.2%MITPHPPHP &gt;=8.0.0

Since Jul 11Pushed 1y agoCompare

[ Source](https://github.com/programster/package-abstract-view)[ Packagist](https://packagist.org/packages/programster/abstract-view)[ Docs](https://github.com/programster/package-abstract-view)[ RSS](/packages/programster-abstract-view/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Abstract View
=============

[](#abstract-view)

This is a simple object to make it easy to build object-oriented views. The views implement the [Stringable interface](https://www.php.net/manual/en/class.stringable.php), so they can easily be passed around and used just as strings.

Example Usage
-------------

[](#example-usage)

Include the package by running:

```
composer require programster/abstract-view
```

Views are treated as objects, and you can use objects within objects. For example, you could have a view for your [HTML shell](https://www.toptal.com/developers/htmlshell)like so:

```

    .body { width: auto; }

```

... and then a view for a "partial" that represents the body of the page like so:

```

Hello World!
Welcome to my site!

```

Then you cat "build" the page by stitching the views together like so:

```
