Template Engine for PHP
Fenóm - lightweight and fast template engine for PHP.
composer require fenom/fenom
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-0PHP standard to load classes which are located in the
src/directory. Templater already has own autoload-function, to register call method
There is two way to create Fenom instance:
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:
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:
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.