fenom

Template Engine for PHP

Github星跟踪图

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

主要指标

概览
名称与所有者fenom-template/fenom
主编程语言PHP
编程语言PHP (语言数: 2)
平台
许可证Other
所有者活动
创建于2013-06-28 06:48:32
推送于2024-09-08 08:59:44
最后一次提交2024-09-08 10:59:44
发布数36
最新版本名称v3.0.0 (发布于 )
第一版名称1.4.9 (发布于 )
用户参与
星数448
关注者数46
派生数108
提交数706
已启用问题?
问题数206
打开的问题数26
拉请求数108
打开的拉请求数5
关闭的拉请求数28
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?