2017 © Pedro Peláez
 

library wing-commander

Mustache template library wrapper for the Flight microframework

image

xmeltrut/wing-commander

Mustache template library wrapper for the Flight microframework

  • Sunday, May 22, 2016
  • by xmeltrut
  • Repository
  • 1 Watchers
  • 7 Stars
  • 253 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 16 % Grown

The README.md

Wing Commander

Latest Stable Version License, (*1)

Wing Commander is a Mustache wrapper for the Flight PHP microframework., (*2)

Installation

The easiest way to install Wing Commander is using Composer. Create a composer.json file in the root of your project and require Wing Commander., (*3)

{
    "require": {
        "xmeltrut/wing-commander": "*"
    }
}

Then run the install command, and this will install all dependencies - including Flight and Mustache., (*4)

composer install

Usage

A basic usage would look like the following., (*5)

require 'vendor/autoload.php';

WingCommander::init();

Flight::route('/', function(){
    Flight::view()->set("someVar", "Hello, World!");
    Flight::render("homepage", array(), "body");
    Flight::render("layout", array("title" => $pageTitle));
});

Flight::start();

By default, it will look for Mustache templates in the ./templates directory of your project. You can change this by calling the setTemplatePath method., (*6)

Flight::view()->setTemplatePath("./application/templates");

Lets create homepage.mustache., (*7)

<p>{{someVar}}</p>

A layout to wrap it in too - layout.mustache., (*8)

<p>Wing Commander says:</p>
{{{body}}}

Bringing it all together, you can use it like you would use the standard Flight view component., (*9)

Flight::view()->set("someVar", "Hello, World!");
Flight::render("homepage", array(), "body");
Flight::render("layout", array("title" => $pageTitle));

Further Reading

The Versions

22/05 2016

dev-master

9999999-dev

Mustache template library wrapper for the Flight microframework

  Sources   Download

MIT

The Requires

 

mustache microframework flight

30/12 2015

1.2.0

1.2.0.0

Mustache template library wrapper for the Flight microframework

  Sources   Download

MIT

The Requires

 

mustache microframework flight

17/11 2014

dev-dev

dev-dev

Mustache template library wrapper for the Flight microframework

  Sources   Download

The Requires

 

mustache microframework flight

13/11 2012

1.1.0

1.1.0.0

Mustache template library wrapper for the Flight microframework

  Sources   Download

The Requires

 

mustache microframework flight