2017 © Pedro Peláez
 

library views

A HTTP Message compatible template engine abstraction.

image

laasti/views

A HTTP Message compatible template engine abstraction.

  • Wednesday, May 3, 2017
  • by nebulousGirl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 101 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 6 Versions
  • 11 % Grown

The README.md

Laasti/views

A HTTP Message compatible template engine abstraction. Provides a TemplateStream that can be attached to HTTP Message's Response., (*1)

Only support PHP and Mustache (bobthecow/mustache.php) templates for the moment, PRs are welcome to add more engines., (*2)

Installation

composer require laasti/views

Usage

$renderer = new \Laasti\Views\TemplateRenderer;
//You can add many engines to support multiple template types
$renderer->addEngine(new \Laasti\Views\Engines\PlainPhp([/*View directory*/]));
//You can set global data to pass on to all template
$renderer->setData('sitename', 'Hello world!');
//Or you can pass data only to one template
$template = new \Laasti\Views\Template("template-name.php", new \Laasti\Views\Data\ArrayData(['title' => 'Hello world!']));
//attackStream will create a TemplateStream and attach it to the response's body
$response = $renderer->attachStream($response, $template);

//The title and sitename will be available as $title and $sitename in the template

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

See Github's releases or tags, (*3)

Credits

Author: Sonia Marquette (@nebulousGirl), (*4)

License

Released under the MIT License. See LICENSE.txt file., (*5)

The Versions

03/05 2017

dev-master

9999999-dev

A HTTP Message compatible template engine abstraction.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr psr-7 templating http message templates laasti

03/05 2017

v0.2.3

0.2.3.0

A HTTP Message compatible template engine abstraction.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr psr-7 templating http message templates laasti

19/10 2016

v0.2.2

0.2.2.0

A HTTP Message compatible template engine abstraction.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr psr-7 templating http message templates laasti

04/05 2016

v0.2.1

0.2.1.0

A HTTP Message compatible template engine abstraction.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr psr-7 templating http message templates laasti

09/04 2016

v0.2

0.2.0.0

A HTTP Message compatible template engine abstraction.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr psr-7 templating http message templates laasti

21/02 2016

v0.1

0.1.0.0

A HTTP Message compatible template engine abstraction.

  Sources   Download

MIT

The Requires

 

The Development Requires

psr psr-7 templating http message templates laasti