PHPackages                             torohill/php-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. torohill/php-template

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

torohill/php-template
=====================

A very basic template class that uses PHP as the templating language.

2.1.1(6y ago)021[1 issues](https://github.com/torohill/php-template/issues)MITPHPPHP &gt;=5.3

Since May 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/torohill/php-template)[ Packagist](https://packagist.org/packages/torohill/php-template)[ Docs](https://github.com/torohill/php-template/)[ RSS](/packages/torohill-php-template/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (7)Used By (0)

PHP Template
============

[](#php-template)

A very basic template library that uses PHP as the templating language.

Installation
------------

[](#installation)

Add the following to the requires section in your `composer.json` file and then run `composer install`.

```
"torohill/php-template": "2.*"

```

Requirements
------------

[](#requirements)

PHP &gt;= 5.3

Usage
-----

[](#usage)

1. Create a `\PhpTemplate\Template` object.
2. Assign template variables as member variables.
3. Call `Template->execute()` to retrieve the rendered template.

It is also possible to use the static `Template::render()` method to assign variables and execute in a single call.

### Example Usage

[](#example-usage)

example.php

```
