Skip to content

Latest commit

 

History

History
124 lines (71 loc) · 3.45 KB

README-en.md

File metadata and controls

124 lines (71 loc) · 3.45 KB

It will be different if you stand behind.

 

Avane GitHub release Coverage Status

Avane is a template engine written in PHP. It supports random CSS style names,

and packing JS files.

 

Features

  1. PJAX - single page technology

  2. Less PHP codes.

  3. Multiple templates.

  4. Supports packing JS and CSS files.

  5. Compiling Coffee and Sass files automatically.

  6. Jade-like coding style, though you are still able to write templates in HTML.

  7. Configure your templates in YAML configuration files, without YAML modules.

 

Build status

Service Status
Travis CI Build Status
Caris Events Build Status

 

Tutorials

We have moved the tutorials to Gitbook.

You can read a complete Avane document on Gitbook.

Or even download the document as PDF files to read them at anytime.

 

Examples

Construct an Avane class, and pass the path of templates directory.

$avane = new Avane\Main('default');

 

Create a template like below and save it to default/tpls/homepage.jade.

div
    Hey, I'm #{$name}!

 

Next, create a Jade file named index.jade and copy the code below into it.

$avane = new Avane\Main('default');

$avane->render('homepage', ['name' => 'Yami Odymel']);

 

Finally, access index.php with your browser and you should get this:

<div>Hey, I'm Yami Odymel!</div>

 

References

Get inspired, use Avane better by reading these.

Writing a simple lexer in PHP

超简单实用的php 模板引擎

自制php模板引擎第二版

Latte: amazing template engine for PHP

Roll Your Own Templating System in PHP

Creating a Simple Template Engine with OO PHP.

Simple PHP Template Engine

Creating your own template engine in JavaScript: part 1

Nunjucks

How to Use PHP instead of Twig for Templates

Dust PHP

TWIG

Getting Started With PHP Templating

Templating Engines in PHP

Talesoft/tale-jade