2017 © Pedro Peláez
 

library bind-view

Binds icanboogie/view to ICanBoogie

image

icanboogie/bind-view

Binds icanboogie/view to ICanBoogie

  • Sunday, March 18, 2018
  • by olvlvl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 512 Installations
  • PHP
  • 3 Dependents
  • 2 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

bind-view

Release Build Status Code Quality Code Coverage Packagist, (*1)

The icanboogie/bind-view package binds icanboogie/view to 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., (*2)

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., (*3)

The View instance is created with the controller and the Renderer instance returned by [get_renderer()][]., (*4)

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:, (*5)

<?php

use ICanBoogie\Routing\Controller;

class ArticlesController extends Controller
{
    use Controller\ResourceTrait;

    protected function index()
    {
        $this->view->content = $this->model->own->visible->ordered->limit(10);
        $this->view['title'] = "Ten last articles";
    }
}

Note: The model getter is provided by the icanboogie/module package, and is only available if the route has a module property, which is automatic for routes defined by modules., (*6)

For more information continue to the View documentation., (*7)


Requirements

The package requires PHP 5.6 or later., (*8)

Installation

The recommended way to install this package is through Composer:, (*9)

$ composer require icanboogie/bind-view

Cloning the repository

The package is available on GitHub, its repository can be cloned with the following command line:, (*10)

$ git clone https://github.com/ICanBoogie/bind-view.git

Documentation

The package is documented as part of the ICanBoogie framework documentation. You can generate the documentation for the package and its dependencies with the make doc command. The documentation is generated in the build/docs directory. ApiGen is required. The directory can later be cleaned with the make clean command., (*11)

Testing

The test suite is ran with the make test command. PHPUnit and Composer need to be globally available to run the suite. The command installs dependencies as required. The make test-coverage command runs test suite and also creates an HTML coverage report in "build/coverage". The directory can later be cleaned with the make clean command., (*12)

The package is continuously tested by Travis CI., (*13)

Build Status Code Coverage, (*14)

License

icanboogie/bind-view is licensed under the New BSD License - See the LICENSE file for details., (*15)

The Versions

18/03 2018

5.0.x-dev

5.0.9999999.9999999-dev https://icanboogie.org/

Binds icanboogie/view to ICanBoogie

  Sources   Download

BSD-3-Clause

The Requires

 

18/03 2018

dev-master

9999999-dev https://icanboogie.org/

Binds icanboogie/view to ICanBoogie

  Sources   Download

BSD-3-Clause

The Requires

 

18/03 2018

v0.9.0

0.9.0.0 https://icanboogie.org/

Binds icanboogie/view to ICanBoogie

  Sources   Download

BSD-3-Clause

The Requires

 

13/11 2016

0.9.x-dev

0.9.9999999.9999999-dev http://icanboogie.org/

Binds icanboogie/view to ICanBoogie

  Sources   Download

BSD-3-Clause

The Requires

 

23/01 2016

v0.8.0

0.8.0.0 http://icanboogie.org/

Binds icanboogie/view to ICanBoogie

  Sources   Download

BSD-3-Clause

The Requires

 

23/01 2016

v0.7.0

0.7.0.0 http://icanboogie.org/

Binds icanboogie/view to ICanBoogie

  Sources   Download

BSD-3-Clause

The Requires

 

12/07 2015

v0.3.0

0.3.0.0 http://icanboogie.org/

Binds icanboogie/view to ICanBoogie

  Sources   Download

BSD-3-Clause

The Requires

 

08/03 2015

v0.2.2

0.2.2.0 http://icanboogie.org/

Binds icanboogie/view to ICanBoogie

  Sources   Download

BSD-3-Clause

The Requires

 

25/02 2015

v0.2.1

0.2.1.0 http://icanboogie.org/

Binds icanboogie/view to ICanBoogie

  Sources   Download

BSD-3-Clause

The Requires

 

23/02 2015

v0.2.0

0.2.0.0 http://icanboogie.org/

Binds icanboogie/view to ICanBoogie

  Sources   Download

BSD-3-Clause

The Requires

 

06/02 2015

v0.1.0

0.1.0.0 http://icanboogie.org/

Binds icanboogie/view to ICanBoogie

  Sources   Download

BSD-3-Clause

The Requires