Git Product home page Git Product logo

fenom's Introduction

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's People

Contributors

bzick avatar maxisoft-git avatar pafnuty avatar klkvsk avatar loki3000 avatar sleuthhound avatar daisuke-sama avatar tsukasa-mixer avatar zhabinka avatar igorhim avatar bakatrouble avatar vasia123 avatar sreenadh avatar mungell avatar dakiesse avatar electrica avatar jorgenpo avatar paw34rus avatar evseevnn avatar xesau avatar neronmoon avatar bezumkin avatar pborreli avatar antonokulov avatar ig0r74 avatar kulaginds avatar nekufa avatar diimpp avatar daager avatar fobo66 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.