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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?