fenom / fenom
Fenom - excellent template engine for PHP
Installs: 95 258
Dependents: 26
Suggesters: 3
Security: 1
Stars: 444
Watchers: 46
Forks: 107
Open Issues: 34
pkg:composer/fenom/fenom
Requires
- php: >=8.0.0
- ext-tokenizer: *
Requires (Dev)
- phpunit/phpunit: 9.*
- dev-master
- v3.0.0.x-dev
- v3.0.0
- 2.12.1
- 2.12.0
- 2.11.9
- 2.11.8
- 2.11.7
- 2.11.6
- 2.11.5
- 2.11.4
- 2.11.3
- 2.11.2
- 2.11.1
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.2
- 2.8.1
- 2.8.0
- 2.7.1
- 2.7.0
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.4
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.6
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.4.9
- dev-dependabot/composer/phpunit/phpunit-9.6.33
- dev-develop
- dev-revert-232-patch-1
- dev-fix-mbstring
This package is auto-updated.
Last update: 2026-01-28 01:22:26 UTC
README
Create issue if you want to be a maintainer of Fenom
Fenom - Template Engine for PHP
Fenóm - lightweight and fast template engine for PHP.
- Subject: Template engine
- Syntax: Smarty-like
- Documentation: English, Russian
- PHP version: 8.0+
- State:
- Version:
- Packagist: fenom/fenom
- Composer:
composer require fenom/fenom - Discussion: Fenom Forum
- Versioning: semver2
- Performance: see benchmark
Quick Start
Install
If you use composer in your project then you can to install Fenom as package.
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.