2017 © Pedro Peláez
 

library-assets templatengine

A PHP package to build HTML5 views (based on HTML5 Boilerplate layouts).

image

atelierspierrot/templatengine

A PHP package to build HTML5 views (based on HTML5 Boilerplate layouts).

  • Saturday, January 2, 2016
  • by picas
  • Repository
  • 1 Watchers
  • 2 Stars
  • 329 Installations
  • HTML
  • 4 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

Template Engine

documentation, (*1)

A PHP package to build HTML5 views (based on HTML5 Boilerplate layouts and the Composer Assets Plugin)., (*2)

What is this package ?

This package defines a simple Template Engine to manage PHP view files, some HTML files including PHP scripts to build views passing them parameters and objects and some tools to manage global layouts to embed these views. As it is based on the Composer Assets Plugin, the Template Engine also facilitate assets files usage and URL., (*3)

This package is not yet really documented. Please take a look at the code and the PHP Documentation for more information. A complete demonstration is available in the package itself (PHP server is required)., (*4)

Installation

This package requires that you use Composer to manage your dependencies., (*5)

To use the package, you need to add it to your requirements in your composer.json AND to call its TemplateEngineInstaller::postAutoloadDump for the post-autoload-dump Composer's event:, (*6)

"require": {
    ...
    "atelierspierrot/templatengine": "1.*"
},
...
"scripts": {
    ...
    "post-autoload-dump": "Assets\\Composer\\TemplateEngineInstaller::postAutoloadDump"
}

The Assets and TemplateEngine namespaces will be automatically added to the project Composer autoloader., (*7)

Composer Extra settings

Using the Template Engine, you can define some extra features in your package's composer.json to specify some paths and presets used by the engine., (*8)

Example

Below is the example of the package default configuration values added to the default Composer Assets Plugin configuration values:, (*9)

"extra": {
    "views": [ "www", "www/html5boilerplate" ],
    "views-functions": "src/TemplateEngine/views_functions.php",
    "cache-dir": "tmp",
    "cache-assets-dir": "tmp_assets",
    "layouts": "www/html5boilerplate"
}

views: array|string

This defines one or more relative paths from your package root directory where to find your view files. These directories must exist and defaults to www/ (the default assets directory)., (*10)

views-functions: array|string

The view functions are loaded before any view rendering and may define some useful methods to use in your view files. See the Views Functions section below for more infos., (*11)

This entry defines one or more relative file paths from your package root directory where to find your view functions. These files must exist., (*12)

cache-dir: string

This defines the relative path from your assets directory to generate temporary files. If it does not exist, the directory will be created. This setting defaults to tmp/., (*13)

cache-assets-dir: string

This defines the relative path from your assets directory to generate temporary assets files such as merged or minifies CSS or JS. If it does not exist, the directory will be created. This setting defaults to tmp_assets/., (*14)

layouts: array|string

This defines one or more relative paths from your package root directory where to find your layout files, the global templates to use as other partial views wrapper. These directories must exist., (*15)

Views functions

Any package defining the extra views-functions setting can define a set of standalone methods to use in view files ; all functions files of the declared views-functions are loaded for all views, so all of these methods may be accessible in any view file., (*16)

Author & License

Template Engine, (*17)

http://github.com/atelierspierrot/templatengine, (*18)

Copyright (c) 2013-2016 Pierre Cassat and contributors, (*19)

Licensed under the Apache 2 license., (*20)

http://www.apache.org/licenses/LICENSE-2.0, (*21)


Les Ateliers Pierrot - Paris, France, (*22)

http://www.ateliers-pierrot.fr/ - contact@ateliers-pierrot.fr, (*23)

The Versions

13/10 2013

v1.0.0

1.0.0.0 http://github.com/atelierspierrot/templatengine

A PHP package to build HTML5 views (based on HTML5 Boilerplate layouts).

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

boilerplate template engine

13/10 2013

0.1.x-dev

0.1.9999999.9999999-dev http://github.com/atelierspierrot/templatengine

A PHP package to build HTML5 views (based on HTML5 Boilerplate layouts).

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

template boilerplate

13/10 2013

v0.1.0

0.1.0.0 http://github.com/atelierspierrot/templatengine

A PHP package to build HTML5 views (based on HTML5 Boilerplate layouts).

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

template boilerplate