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

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

icanboogie/view
===============

Provides view support to ICanBoogie

v0.10.0(4y ago)01.1k1BSD-3-ClausePHPPHP &gt;=7.2

Since Feb 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ICanBoogie/View)[ Packagist](https://packagist.org/packages/icanboogie/view)[ Docs](https://icanboogie.org/)[ RSS](/packages/icanboogie-view/feed)WikiDiscussions 6.0 Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (14)Used By (1)

View
====

[](#view)

[![Release](https://camo.githubusercontent.com/b240bc340feab372d40918d6834e85f71411fae756a0dbf14ede754183f6284f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6963616e626f6f6769652f766965772e737667)](https://packagist.org/packages/icanboogie/view)[![Code Coverage](https://camo.githubusercontent.com/505dfcb8d0b16e91e960f992e4caad4ed85585f38dc375d030b45c422b238cf8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4943616e426f6f6769652f566965772f62616467652e7376673f6272616e63683d362e30)](https://coveralls.io/r/ICanBoogie/View?branch=6.0)[![Downloads](https://camo.githubusercontent.com/fffe9be3817fd169680f04959ae46add5e5fa85ef784e5565c25bbc6553ede7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6963616e626f6f6769652f766965772e737667)](https://packagist.org/packages/icanboogie/view)

The **icanboogie/view** package provides the *view* part of the model-view-controller (MVC) architectural pattern. It extends the features of the [icanboogie/routing](https://github.com/ICanBoogie/Routing) package—more precisely its controllers—and together with the [icanboogie/render](https://github.com/ICanBoogie/Render) package it helps in separating presentation from logic.

#### Installation

[](#installation)

```
composer require icanboogie/view
```

Getting started
---------------

[](#getting-started)

Before you get started you'll need to define some prototype methods to bind some *render*components to [View](https://icanboogie.org/api/view/0.10/class-ICanBoogie.View.View.html) instances, and [View](https://icanboogie.org/api/view/0.10/class-ICanBoogie.View.View.html) instances to the [Controller](https://icanboogie.org/api/routing/5.0/class-ICanBoogie.Routing.Controller.html) instances that use them.

If you use the **icanboogie/view** package with [ICanBoogie](https://github.com/ICanBoogie/ICanBoogie), you can simply require the [icanboogie/bind-view](https://github.com/ICanBoogie/bind-view) package and let it deal with bindings.

The following code demonstrates how to bind `view` prototype property of [Controller](https://icanboogie.org/api/routing/5.0/class-ICanBoogie.Routing.Controller.html) instances. The binding is defined by the [ControllerBindings](https://icanboogie.org/api/view/0.10/class-ICanBoogie.View.ControllerBindings.html) traits.

```
