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

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

eden/template
=============

Eden template component.

4.0.1(10y ago)08.5k2MITPHPPHP &gt;=5.3.1

Since Sep 24Pushed 10y ago12 watchersCompare

[ Source](https://github.com/Eden-PHP/Template)[ Packagist](https://packagist.org/packages/eden/template)[ Docs](http://eden-php.com)[ RSS](/packages/eden-template/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (1)Versions (6)Used By (2)

[![logo](https://camo.githubusercontent.com/683ba05b2b51f50045c674b19a4f0ceb30702a8ab495623be7c02e07ab226f08/687474703a2f2f6564656e2e6f70656e6f766174652e636f6d2f6173736574732f696d616765732f636c6f75642d736f6369616c2e706e67)](https://camo.githubusercontent.com/683ba05b2b51f50045c674b19a4f0ceb30702a8ab495623be7c02e07ab226f08/687474703a2f2f6564656e2e6f70656e6f766174652e636f6d2f6173736574732f696d616765732f636c6f75642d736f6369616c2e706e67) Eden Template
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#-eden-template)

[![Build Status](https://camo.githubusercontent.com/906b8f6cae7f5ea255a6e8e67047f67490a23a1579a166c7e16b5484cf1364c9/68747470733a2f2f6170692e7472617669732d63692e6f72672f4564656e2d5048502f54656d706c6174652e737667)](https://travis-ci.org/Eden-PHP/Template)
==============================================================================================================================================================================================================================================================

[](#)

- [Install](#install)
- [Introduction](#intro)
- [API](#api)
    - [set](#set)
    - [parseEngine](#parseEngine)
    - [parseString](#parseString)
    - [parsePhp](#parsePhp)
- [Contributing](#contributing)

====

Install
-------

[](#install)

`composer install eden/template`

====

Introduction
------------

[](#introduction)

Instantiate template in this manner.

```
$template = eden('template');

```

====

API
---

[](#api)

====

### set

[](#set)

Sets template variables

#### Usage

[](#usage)

```
eden('template')->set(*array|string $data, mixed $value);

```

#### Parameters

[](#parameters)

- `*array|string $data` - data
- `mixed $value` - value

Returns `Eden\Template\Index`

#### Example

[](#example)

```
eden('template')->set(array('foo' => 'bar'));

```

====

### parseEngine

[](#parseengine)

Engine Parser. This parser also cases for lazy loaded variables. One problem with template engines is that it requires you to preload variables. This becomes problematic when your template requires a plethora of MySQL, Facebook, Twitter calls for example. Sometimes it's just best to wait till it's needed. ex {$title} ex {products}{$title}{/products}

#### Usage

[](#usage-1)

```
eden('template')->parseEngine(*string $template, callable|null $callback);

```

#### Parameters

[](#parameters-1)

- `*string $template` - The template string
- `callable|null $callback` - Callback to be used when key does not exist in data

Returns `string`

#### Example

[](#example-1)

```
eden('template')->parseEngine('foo');

```

====

### parseString

[](#parsestring)

Simple string replace template parser

#### Usage

[](#usage-2)

```
eden('template')->parseString(*string $string);

```

#### Parameters

[](#parameters-2)

- `*string $string` - The template string

Returns `string`

#### Example

[](#example-2)

```
eden('template')->parseString('foo');

```

====

### parsePhp

[](#parsephp)

For PHP templates, this will transform the given document to an actual page or partial

#### Usage

[](#usage-3)

```
eden('template')->parsePhp(*string $___file, bool $___evalString);

```

#### Parameters

[](#parameters-3)

- `*string $___file` - Template file or PHP template string
- `bool $___evalString` - Whether to evaluate the first argument

Returns `string`

#### Example

[](#example-3)

```
eden('template')->parsePhp('foo');

```

====

\#Contributing to Eden

Contributions to *Eden* are following the Github work flow. Please read up before contributing.

\##Setting up your machine with the Eden repository and your fork

1. Fork the repository
2. Fire up your local terminal create a new branch from the `v4` branch of your fork with a branch name describing what your changes are. Possible branch name types:
    - bugfix
    - feature
    - improvement
3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

\##Making pull requests

1. Please ensure to run `phpunit` before making a pull request.
2. Push your code to your remote forked version.
3. Go back to your forked version on GitHub and submit a pull request.
4. An Eden developer will review your code and merge it in when it has been classified as suitable.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

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 ~195 days

Total

5

Last Release

3883d ago

Major Versions

1.0.3 → 4.0.12015-10-13

PHP version history (2 changes)1.0.2PHP &gt;=5.3.1

4.x-devPHP &gt;=5.4.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/120378?v=4)[Christian Blanquera](/maintainers/cblanquera)[@cblanquera](https://github.com/cblanquera)

---

Top Contributors

[![clark21](https://avatars.githubusercontent.com/u/5639521?v=4)](https://github.com/clark21 "clark21 (6 commits)")

---

Tags

libraryeden

### Embed Badge

![Health badge](/badges/eden-template/health.svg)

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

###  Alternatives

[eden/mail

Eden POP3, IMAP and SMTP component

179275.6k1](/packages/eden-mail)[contributte/forms-bootstrap

Nette extension for Bootstrap forms

211.1M4](/packages/contributte-forms-bootstrap)

PHPackages © 2026

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