Go to file
Daisuke-sama a005732286 Update syntax.md
1. Исправлена ссылка в разделе "Использование переменных"
2. Описка в разделе "Модификаторы"
3. Опечатка в разделе "Параметры тегов"
2016-05-26 15:27:23 +02:00
docs Update syntax.md 2016-05-26 15:27:23 +02:00
sandbox Done #228 2016-05-08 18:26:01 +03:00
src Done #228 2016-05-08 18:26:01 +03:00
tests Done #228 2016-05-08 18:26:01 +03:00
.coveralls.yml Update .coveralls.yml 2015-01-30 17:18:53 +03:00
.gitignore Add composer.lock to git 2015-02-19 17:12:33 +03:00
.travis.yml Support PHP 7.0 (again) 2015-10-10 23:20:00 +03:00
authors.md Update authors.md 2013-07-04 01:48:54 +04:00
CHANGELOG.md Docs++ 2016-05-08 00:57:02 +03:00
composer.json Back to coveralls.io 2014-08-06 23:36:04 +04:00
composer.lock Fix: parse error if macro defined without arguments 2015-04-26 22:24:20 +03:00
license.md Add licenses 2013-04-28 18:08:57 +04:00
phpunit.xml.dist Change code coverage system to CodeClimate 2014-07-29 23:33:28 +04:00
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