PHPackages                             phile/content-variables - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phile/content-variables

ActivePhile-plugin[Utility &amp; Helpers](/categories/utility)

phile/content-variables
=======================

A plugin to add custom variables in your content before it is parsed.

1.0.1(8y ago)1113MITPHP

Since Mar 7Pushed 8y ago2 watchersCompare

[ Source](https://github.com/PhileCMS/phileContentVariables)[ Packagist](https://packagist.org/packages/phile/content-variables)[ Docs](http://philecms.com)[ RSS](/packages/phile-content-variables/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

phileContentVariables
=====================

[](#philecontentvariables)

A plugin for [Phile](https://github.com/PhileCMS/Phile) to add custom variables in your content before it is parsed.

### 1.1 Installation (composer)

[](#11-installation-composer)

```
composer require phile/content-variables

```

### 1.2 Installation (Download)

[](#12-installation-download)

- Install the latest version of [Phile](https://github.com/PhileCMS/Phile)
- Clone this repo into `plugins/phile/contentVariables`

### 2. Activation

[](#2-activation)

After you have installed the plugin. You need to add the following line to your `config.php` file:

```
$config['plugins']['phile\\contentVariables'] = array('active' => true);

```

### Usage

[](#usage)

You **must have** a `variables` array in your config.

```
$config['variables'] = array(
  'site_title' => $config['site_title'],
  'base_url' => 'https://example.com/
);
```

These keys are the variables, and the value is what the replaced string will be. So now when you reference `%base_url%` in your markdown/textile/content pages, it will be rendered as your real base URL:

```
This is a link to my [base URL](%base_url%)
```

Will be rendered as:

```
This is a link to my base URL
```

Another example for a site with the title *PhileCMS*:

```
Welcome to %site_title%!
```

Becomes:

```
Welcome to PhileCMS!
```

### Config

[](#config)

This plugin allows the open and close tags for your variables to be set. By default they are both set to the following:

```
'open_tag' => '%', // the open tag for the variable
'close_tag' => '%' // the close tag for the variable
```

This means any text wrapped with `%` signs will be replaced.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

2

Last Release

2994d ago

### Community

Maintainers

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

---

Top Contributors

[![james2doyle](https://avatars.githubusercontent.com/u/1425304?v=4)](https://github.com/james2doyle "james2doyle (6 commits)")[![NeoBlack](https://avatars.githubusercontent.com/u/1128085?v=4)](https://github.com/NeoBlack "NeoBlack (5 commits)")[![Schlaefer](https://avatars.githubusercontent.com/u/143224?v=4)](https://github.com/Schlaefer "Schlaefer (2 commits)")

---

Tags

philephilecms-plugincontentcmsphile

### Embed Badge

![Health badge](/badges/phile-content-variables/health.svg)

```
[![Health](https://phpackages.com/badges/phile-content-variables/health.svg)](https://phpackages.com/packages/phile-content-variables)
```

PHPackages © 2026

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