se7enxweb/str_replace
Composer 安装命令:
composer require 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.
关键字:
README 文档
README
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
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
-
Extract or clone the repository into your
extension/directory so that the path becomes:extension/str_replace/ -
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_replaceIf the
[ExtensionSettings]block already exists, just append the second line. -
Clear the cache:
php bin/php/ezcache.php --clear-all
Usage
Use the ezstr_replace operator in any eZ Publish template:
{ezstr_replace($search, $replace, $subject)}
| Parameter | Type | Required | Description |
|---|---|---|---|
$search |
string | yes | The value to search for |
$replace |
string | yes | The replacement value |
$subject |
string | yes | The string to perform the search on |
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
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
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 http://www.gnu.org/copyleft/gpl.html.
se7enxweb/str_replace 适用场景与选型建议
se7enxweb/str_replace 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 03 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「extension」 「ez publish」 「eZ Publish Legacy」 「eZ Publish Platform」 「str_replace」 「template operator」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 se7enxweb/str_replace 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 se7enxweb/str_replace 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 se7enxweb/str_replace 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A custom URL rule class for Yii 2 which allows to create translated URL rules
Rabbitevents common package
A Laravel Eloquent model trait for publishable resource
Book publishing application
The Publisher component of the RabbitEvents package.
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 35
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-03-05