https://github.com/fenom-template/fenom
Template Engine for PHP. Maintainers wanted!
https://github.com/fenom-template/fenom
fenom php template-engine
Last synced: about 2 months ago
JSON representation
Template Engine for PHP. Maintainers wanted!
- Host: GitHub
- URL: https://github.com/fenom-template/fenom
- Owner: fenom-template
- License: other
- Created: 2013-06-28T06:48:32.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-09-08T08:59:44.000Z (over 1 year ago)
- Last Synced: 2025-04-10T06:39:45.011Z (10 months ago)
- Topics: fenom, php, template-engine
- Language: PHP
- Homepage:
- Size: 1.34 MB
- Stars: 447
- Watchers: 46
- Forks: 108
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: license.md
- Authors: authors.md
Awesome Lists containing this project
README
MAINTAINERS WANTED
===
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](./docs/en/readme.md)**, **[Russian](./docs/ru/readme.md)**
* **PHP version:** 8.0+
* **State:** [](https://github.com/fenom-template/fenom/actions/workflows/php.yml) [](https://coveralls.io/r/fenom-template/fenom?branch=master)
* **Version:** [](https://packagist.org/packages/fenom/fenom)
* **Packagist:** [fenom/fenom](https://packagist.org/packages/fenom/fenom) [](https://packagist.org/packages/fenom/fenom)
* **Composer:** `composer require fenom/fenom`
* **Discussion:** [Fenom Forum](https://groups.google.com/forum/#!forum/php-ion)
* **Versioning:** [semver2](http://semver.org/)
* **Performance:** see [benchmark](./docs/en/benchmark.md)
***
## 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:
```php
$fenom = new Fenom(new Fenom\Provider($template_dir));
```
After that, set compile directory:
```php
$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:
```php
$fenom->setOptions($options);
```
**Short way.** Creating an object via factory method with arguments from long way.
```php
$fenom = Fenom::factory($template_dir, $template_cache_dir, $options);
```
Now Fenom is ready to work.
### Usage
### Example