Go to file
Vasily Naumkin 6a7291fac6 Fixed method tagPaste
We need to remove quotes from names of blocks to get them from array.
2017-06-26 12:47:19 +03:00
docs Merge pull request #270 from fenom-template/develop 2017-04-22 22:48:52 +03:00
sandbox Fix #260 2017-04-22 15:59:20 +03:00
src Fixed method tagPaste 2017-06-26 12:47:19 +03:00
tests Phpunit things 2017-04-22 16:39:33 +03:00
.coveralls.yml Fixed: Unrecognized option "src_dir" under "coveralls" 2016-10-10 11:58:50 +03:00
.gitignore Add composer.lock to git 2015-02-19 17:12:33 +03:00
.travis.yml Phpunit things 2017-04-22 16:29:44 +03:00
authors.md
CHANGELOG.md Update CHANGELOG.md 2016-06-09 22:58:05 +03:00
composer.json Phpunit things 2017-04-22 16:25:04 +03:00
composer.lock phpunit 5.* 2017-04-22 15:00:48 +03:00
license.md
phpunit.xml.dist
README.md Docs++ 2016-05-08 00:38:17 +03:00

Fenom - Template Engine for PHP

Fenóm - lightweight and fast template engine for PHP.


Quick Start

Install

If you use composer in your project then you can to install Fenom as package. However, if you are not using composer you have to configure autoloader to work with Fenom. Fenom implements the PSR-0 PHP standard to load classes which are located in the src/ directory. Templater already has own autoload-function, to register call method Fenom::registerAutoload:

Fenom::registerAutoload();

Setup

There is two way to create Fenom instance:

  • Long way: use operator new
  • Shot way: use static factory-method

Long way. Create you own template provider or default provider Fenom\Provider (that is provider read there). Using provider instance create Fenom instance:

$fenom = new Fenom(new Fenom\Provider($template_dir));

After that, set compile directory:

$fenom->setCompileDir($template_cache_dir);

This directory will be used for storing compiled templates, therefore it should be writable for Fenom. Now Fenom is ready to work and now you can to configure it:

$fenom->setOptions($options);

Short way. Creating an object via factory method with arguments from long way.

$fenom = Fenom::factory($template_dir, $template_cache_dir, $options);

Now Fenom is ready to work.

Usage

Example