PHPackages                             ride/lib-template - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. ride/lib-template

ActiveLibrary[Templating &amp; Views](/categories/templating)

ride/lib-template
=================

Template library of the Ride framework.

1.0.2(9y ago)05.1k16MITPHP

Since Oct 24Pushed 9y ago7 watchersCompare

[ Source](https://github.com/all-ride/ride-lib-template)[ Packagist](https://packagist.org/packages/ride/lib-template)[ RSS](/packages/ride-lib-template/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (12)Used By (16)

Ride: Template Library
======================

[](#ride-template-library)

Template abstraction library of the PHP Ride framework.

What's In The Library
---------------------

[](#whats-in-the-library)

### Engine

[](#engine)

The implementation of *Engine* will implement the actual template engine through the *Template* interface. A template engine decides the features and the syntax (or language) to write in.

### EngineModel

[](#enginemodel)

An *EngineModel* is an interface for the data store of the available template engines.

### Theme

[](#theme)

Optional support for template themes through the *Theme* interface. Each theme can implement it's own version of a template. This makes it possible to return a different representation of the same data.

A theme chooses the engines it's available in.

You can make a theme hierarchical by defining it's parent. This makes it easy to create subthemes and helps the engine to fallback when a resource could not be found.

### ThemeModel

[](#thememodel)

A *ThemeModel* is an interface for the data store of the available themes.

### Template

[](#template)

A *Template* instance defines the resource and the variables to render the template. With a *ThemedTemplate*, you can specify a template in a specific theme.

The resource should be generic so it's not bound to a specific template engine. For example: use *base/index* instead of *view/smarty/themes/bootstrap/base/index.tpl*.

Code Sample
-----------

[](#code-sample)

Check this code sample to get an idea of this library:

```
