PHPackages                             cobbdb/eta - 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. cobbdb/eta

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

cobbdb/eta
==========

A lightweight PHP templating engine.

v2.0.7(9y ago)112.0k↓40%MITPHPPHP &gt;=4.0.0

Since Jan 13Pushed 8y agoCompare

[ Source](https://github.com/cobbdb/eta)[ Packagist](https://packagist.org/packages/cobbdb/eta)[ Docs](http://github.com/cobbdb/eta)[ RSS](/packages/cobbdb-eta/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

Eta
===

[](#eta)

### A lightweight PHP templating engine designed for rapid prototypes and small-scale web applications.

[](#a-lightweight-php-templating-engine-designed-for-rapid-prototypes-and-small-scale-web-applications)

```
composer require cobbdb/eta

```

[![Latest Stable Version](https://camo.githubusercontent.com/07be86504e9bea5621d2783dc68e40dcad578f42c480bf8722c3c3963fad23e4/68747470733a2f2f706f7365722e707567782e6f72672f636f626264622f6574612f76657273696f6e2e737667)](https://packagist.org/packages/cobbdb/eta) [![Monthly Downloads](https://camo.githubusercontent.com/2c84f2615b7d2c4b00f3f6c3195da99006c4752bb2e0883a891b4dd6b585766a/68747470733a2f2f706f7365722e707567782e6f72672f636f626264622f6574612f642f6d6f6e74686c792e737667)](https://packagist.org/packages/cobbdb/eta) [![License](https://camo.githubusercontent.com/7877dec45df83764c0691b6ee13cf39d9a895781aab73bf0ad767fba030b61c1/68747470733a2f2f706f7365722e707567782e6f72672f636f626264622f6574612f6c6963656e73652e737667)](https://packagist.org/packages/cobbdb/eta)

---

The symbol for the Greek capital letter eta is H. Eta is often used in math as the symbol for efficiency.

This engine was designed for prototypes and small-scale web applications that need to be developed and deployed quickly with minimal setup. Since Eta does not use custom template tags, projects can be easily turned over to a more robust framework like Cake or Yii in the future.

### Installation

[](#installation)

- Copy this file into a directory of your choosing and add the require\_once to the file that is using Eta.
- The default directory for Eta is `./`, but may be changed via `H::setHome()`.
- The default page template for Eta is `./base.view`, but this may be changed via `H::setBase()`.

### Usage

[](#usage)

###### Here is a simple hello world example:

[](#here-is-a-simple-hello-world-example)

```
// index.php
require_once "H.php";
$who = "World";
echo H::render(null, [
    "name" => $who
]);
```

```
// base.view
Hello !
```

###### Example of a template include:

[](#example-of-a-template-include)

```

```

render(path, \[model\], \[grounded\])
-------------------------------------

[](#renderpath-model-grounded)

Render a template without auto-responding.

**Parameters**

- {String} path - Path to the template or null to use the base template.
- {Array} \[model\] - Data to inject into the template.
- {Boolean} \[grounded\] - False to use a literal path and bypass the home directory.

**Returns** {String}
**Throws** {MissingTemplateException}

```
// The 'grounded' argument can bypass the home directory
$myView = H::render("../my/template.html", [], false);
```

setHome(path, \[remember\])
---------------------------

[](#sethomepath-remember)

Set a new default views directory.

**Paramters**

- {String} path
- {Boolean} \[remember\] - True to retain this as the default directory for use with reset().

```
// Default is the same directory in which eta.php file is placed.
H::setHome("/path/to/my/templates/");
```

setBase(path)
-------------

[](#setbasepath)

Set a new default base page template.

**Paramters**

- {String} path - Complete path to new base template.

```
// Default is ./base.view
H::setBase("/path/to/myBase.html");
// Now H::render(null) will use a new base template!
```

reset()
-------

[](#reset)

Reset Eta back to default home directory.

```
// Use special templates directory temporarily.
H::setHome("../path/to/other/templates/");
H::render("some/newThing.tpl");
H::render("and/another/template.html");
// Now reset home back to default for rest of project!
H::reset();
```

---

By Dan Cobb:  - [petitgibier.sytes.net](http://petitgibier.sytes.net)
License: MIT

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~214 days

Total

4

Last Release

3502d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a46407375c4523502684b40054d9052f32bda9aa752de9f3b6ed0c1e38f1887e?d=identicon)[cobbdb](/maintainers/cobbdb)

---

Top Contributors

[![cobbdb](https://avatars.githubusercontent.com/u/1869908?v=4)](https://github.com/cobbdb "cobbdb (32 commits)")

---

Tags

templatingSimpletemplatesfastenginesmall

### Embed Badge

![Health badge](/badges/cobbdb-eta/health.svg)

```
[![Health](https://phpackages.com/badges/cobbdb-eta/health.svg)](https://phpackages.com/packages/cobbdb-eta)
```

###  Alternatives

[league/plates

Plates, the native PHP template system that's fast, easy to use and easy to extend.

1.5k5.9M232](/packages/league-plates)[laminas/laminas-view

Fast and type safe HTML templating library with a flexible plugin system supporting multistep template composition

7526.3M230](/packages/laminas-laminas-view)[mobicms/render

Native PHP template engine

106.7k1](/packages/mobicms-render)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
