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

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

icanboogie/bind-view
====================

Binds icanboogie/view to ICanBoogie

v0.9.0(8y ago)06782BSD-3-ClausePHPPHP &gt;=5.6

Since Feb 6Pushed 1y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (3)Versions (12)Used By (2)

bind-view
=========

[](#bind-view)

[![Release](https://camo.githubusercontent.com/b9478ae856b82579dea0be9385d5570a4ce2d38450d362a946abdd9fa5b8b702/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6963616e626f6f6769652f62696e642d766965772e737667)](https://packagist.org/packages/icanboogie/bind-view)[![Build Status](https://camo.githubusercontent.com/44ac592c5b7ef89380e59e953c989ebac34b732629c452a7e1e8a28f8dcb213e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4943616e426f6f6769652f62696e642d766965772f6d61737465722e737667)](http://travis-ci.org/ICanBoogie/bind-view)[![Code Quality](https://camo.githubusercontent.com/e56db0eb00cbaac784ba7de20c71b3a6fef2c26d0388f38d4d43d87a90c4e08d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4943616e426f6f6769652f62696e642d766965772f6d61737465722e737667)](https://scrutinizer-ci.com/g/ICanBoogie/bind-view)[![Code Coverage](https://camo.githubusercontent.com/b9f88ecd9493ba01df116b5b747f2287312382470f71d01a82a80f5a5e1cf594/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f4943616e426f6f6769652f62696e642d766965772f6d61737465722e737667)](https://coveralls.io/r/ICanBoogie/bind-view)[![Packagist](https://camo.githubusercontent.com/9372906bdcf17f37b8f882eb8a245f234d6d5f75a4eb4e6bcb41c7caff4cb399/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6963616e626f6f6769652f62696e642d766965772e737667)](https://packagist.org/packages/icanboogie/bind-view)

The **icanboogie/bind-view** package binds [icanboogie/view](https://github.com/ICanBoogie/View) to [ICanBoogie](https://github.com/ICanBoogie/ICanBoogie), using its autoconfig feature. It add getters to controllers and views, making it easy to invoke views from controller actions or obtain template engines and resolve templates from views, using features of [icanboogie/render](https://github.com/ICanBoogie/Render).

Views and controllers
---------------------

[](#views-and-controllers)

Views are associated with controllers through the lazy getter `view`, thus a simple `$this->view`is all that is required to enable view features inside a controller. The view then waits for the `Controller::action` event to perform its rendering.

The [View](https://icanboogie.org/api/view/0.9/class-ICanBoogie.View.View.html) instance is created with the controller and the [Renderer](https://icanboogie.org/api/render/0.6/class-ICanBoogie.Render.Renderer.html) instance returned by [`get_renderer()`](https://icanboogie.org/api/render/0.6/function-ICanBoogie.Render.get_renderer.html).

The following example demonstrates how a query of some articles is set as the view content, a title is also added to the view variables:

```
