PHPackages                             se7enxweb/str\_replace - 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. se7enxweb/str\_replace

ActiveEzpublish-legacy-extension[Templating &amp; Views](/categories/templating)

se7enxweb/str\_replace
======================

eZ Publish Legacy extension which provides the ezstr\_replace template operator, wrapping PHP's native str\_replace() for use directly in eZ Publish templates.

v1.0.0(5mo ago)121GPL-2.0-or-laterPHPPHP &gt;=5.0.0

Since Mar 5Pushed 1mo agoCompare

[ Source](https://github.com/se7enxweb/str_replace)[ Packagist](https://packagist.org/packages/se7enxweb/str_replace)[ Docs](https://github.com/se7enxweb/str_replace)[ Fund](https://account.venmo.com/u/se7enxweb)[ Fund](https://cash.app/$7xweb)[ RSS](/packages/se7enxweb-str-replace/feed)WikiDiscussions master Synced 1w ago

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

str\_replace — eZ Publish Template Operator Extension
=====================================================

[](#str_replace--ez-publish-template-operator-extension)

**str\_replace** is an eZ Publish Legacy extension that exposes PHP's native `str_replace()` function as the `{ezstr_replace}` template operator, allowing search-and-replace operations directly inside eZ Publish templates.

- **Author:** Alexandre Abric
- **Initial release:** April 2005
- **License:** GNU General Public License v2

---

About
-----

[](#about)

The extension registers a single template operator, `ezstr_replace`, which wraps PHP's built-in `str_replace()`. It is lightweight, dependency-free, and compatible with any eZ Publish Legacy installation.

---

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

[](#installation)

1. Extract or clone the repository into your `extension/` directory so that the path becomes:

    ```
    extension/str_replace/

    ```
2. Activate the extension. Either use the eZ Publish admin interface (**Setup → Extensions**), or add it manually to `settings/override/site.ini.append.php`:

    ```
    [ExtensionSettings]
    ActiveExtensions[]=str_replace
    ```

    If the `[ExtensionSettings]` block already exists, just append the second line.
3. Clear the cache:

    ```
    php bin/php/ezcache.php --clear-all
    ```

---

Usage
-----

[](#usage)

Use the `ezstr_replace` operator in any eZ Publish template:

```
{ezstr_replace($search, $replace, $subject)}
```

ParameterTypeRequiredDescription`$search`stringyesThe value to search for`$replace`stringyesThe replacement value`$subject`stringyesThe string to perform the search on### Examples

[](#examples)

Replace a word in a plain string:

```
{ezstr_replace('world', 'eZ Publish', 'Hello world!')}
{* Output: Hello eZ Publish! *}
```

Replace content from a node attribute:

```
{def $cleaned = ezstr_replace('-', ' ', $node.name)}
{$cleaned}
```

---

File Structure
--------------

[](#file-structure)

```
extension/str_replace/
├── autoloads/
│   ├── eztemplateautoload.php          # Registers the operator with eZ Publish
│   └── str_replace_controloperator.php # Operator implementation (MyStrReplaceOperator)
├── doc/
│   └── readme.txt                      # Original documentation
├── settings/
│   └── site.ini.append.php             # Extension autoload path setting
├── composer.json
├── ezinfo.php
├── LICENSE
└── README.md

```

---

License
-------

[](#license)

This file may be distributed and/or modified under the terms of the **GNU General Public License** version 2 as published by the Free Software Foundation.

This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

The GNU General Public License (GPL) is available at .

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance81

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

156d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1083669?v=4)[7x](/maintainers/7x)[@7x](https://github.com/7x)

---

Top Contributors

[![se7enxweb](https://avatars.githubusercontent.com/u/51429274?v=4)](https://github.com/se7enxweb "se7enxweb (1 commits)")

---

Tags

arrayscmsexponentialoperatorphpreplacestringstemplateextensionez publisheZ Publish LegacyeZ Publish Platformtemplate operatorstr\_replacestring replace

### Embed Badge

![Health badge](/badges/se7enxweb-str-replace/health.svg)

```
[![Health](https://phpackages.com/badges/se7enxweb-str-replace/health.svg)](https://phpackages.com/packages/se7enxweb-str-replace)
```

PHPackages © 2026

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