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

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dcsg/stringy-template
=====================

Stringy and String Template together

2.0.0(4y ago)131.9k↓41.7%MITPHPPHP ^7.2|^7.4|^8.0|^8.1

Since Mar 10Pushed 4y ago1 watchersCompare

[ Source](https://github.com/dcsg/stringify-template)[ Packagist](https://packagist.org/packages/dcsg/stringy-template)[ Docs](https://github.com/dcsg/stringy-template)[ RSS](/packages/dcsg-stringy-template/feed)WikiDiscussions master Synced 1mo ago

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

StringyTemplate
===============

[](#stringytemplate)

[![Minimum PHP Version](https://camo.githubusercontent.com/cd59ba2b0fddd0cb8a2521a4879d8e1f669d27280c478976a54f08dc3bc59db1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e322d626c75652e737667)](https://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/7864dbabd0654453e7d0a2c4318365b1a855a99b4811d7fb7fc60f845d2d136d/68747470733a2f2f706f7365722e707567782e6f72672f646373672f737472696e67792d74656d706c6174652f762f737461626c65)](https://packagist.org/packages/dcsg/stringy-template)[![License](https://camo.githubusercontent.com/7413980d439c4bee28939a563cbbc612bc9ffa38ced392a5e9f821883cca3958/68747470733a2f2f706f7365722e707567782e6f72672f646373672f737472696e67792d74656d706c6174652f6c6963656e7365)](https://packagist.org/packages/dcsg/stringy-template)[![Build Status](https://camo.githubusercontent.com/fd6169fa26505c65f6894f6818e3a7129426330dca7bcb01af31ea42a4074b33/68747470733a2f2f7472617669732d63692e6f72672f646373672f737472696e67792d74656d706c6174652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dcsg/stringy-template)[![StyleCI](https://camo.githubusercontent.com/64506c5835bfd4ee375207d691795b49e2e4767911b8bd55491ba0f3a7b24364/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3137343739363235382f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/174796258)[![SymfonyInsight](https://camo.githubusercontent.com/a3482ae71442edb0d83d9eeeea4d28e3acad99f375e48320bfebb82450bdb1a8/68747470733a2f2f696e73696768742e73796d666f6e792e636f6d2f70726f6a656374732f65333339633762662d336430342d346532392d393165312d3538613435393532353834382f6d696e692e737667)](https://insight.symfony.com/projects/e339c7bf-3d04-4e29-91e1-58a459525848)[![Quality Gate Status](https://camo.githubusercontent.com/c338434af115d364defe0f98eaa3ef494912a53e70e5933724b8a78110020b17/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d737472696e67792d74656d706c617465266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=stringy-template)[![Coverage](https://camo.githubusercontent.com/3170d0d0661e4a1320c9928e58d0e63c86c9eff24641c511f69029e2d2b7671d/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d737472696e67792d74656d706c617465266d65747269633d636f766572616765)](https://sonarcloud.io/dashboard?id=stringy-template)[![Vulnerabilities](https://camo.githubusercontent.com/abd3060b8e29f7fe9aa20c7ff265dce9279fe71d63ecf334f7a0cea91105a387/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d737472696e67792d74656d706c617465266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/dashboard?id=stringy-template)[![Bugs](https://camo.githubusercontent.com/4265b5d6f5db13790b711d4120d8314f149468ce8314049418ef0fb2caa9d015/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d737472696e67792d74656d706c617465266d65747269633d62756773)](https://sonarcloud.io/dashboard?id=stringy-template)[![Security Rating](https://camo.githubusercontent.com/7afd90f79439bb64b73df6e0510ffc564fbffe1f8d127de3fb5d3461049360bd/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d737472696e67792d74656d706c617465266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/dashboard?id=stringy-template)[![Total Downloads](https://camo.githubusercontent.com/206a99e218cdcfd42db82590aa52fed5bd4c9901035e563abe0cb23b7f4fdb85/68747470733a2f2f706f7365722e707567782e6f72672f646373672f737472696e67792d74656d706c6174652f646f776e6c6f616473)](https://packagist.org/packages/dcsg/stringy-template)

This Library provides a unified `S` Class that "glues" two amazing libraries. It integrates the [Stringy](https://github.com/danielstjules/Stringy) library created by [Daniel St. Jules](https://github.com/danielstjules) and the [StringTemplate](https://github.com/nicmart/StringTemplate) Library create by [Nicolò Martini](https://github.com/nicmart). The **Stringy** Library is a **string manipulation** library, while the **String Template** is an engine to render string templates.

This Library was created because in my projects I've been using both libraries and always ended up in having them integrated into a single class to make it's usage simpler.

Install
-------

[](#install)

Via Composer

```
$ composer require dcsg/stringy-template
```

Usage
-----

[](#usage)

For the full list of features of Stringy see it's [documentation](https://github.com/danielstjules/Stringy), for more details on the String Template you can also check their [documentation](https://github.com/nicmart/StringTemplate).

```
echo S::render(
    'Hello, my name is {firstName} {lastName}.',
    ['firstName' => 'Daniel', 'lastName' => 'Gomes']
);
// "Hello, my name is Daniel Gomes."

// Using conversion specifications from `sprintf`
echo S::render(
    'I have {num%.1f} {fruit}.',
    ['num' => 1.5345, 'fruit' => 'oranges']
);
// "I have 1.5 oranges."

echo S::join(['one', 'two', 'three'], ', ');
// "one, two, three"
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE OF CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Daniel Gomes](https://github.com/dcsg)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

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

Total

2

Last Release

1519d ago

Major Versions

1.0.0 → 2.0.02022-03-21

PHP version history (2 changes)1.0.0PHP ^7.2

2.0.0PHP ^7.2|^7.4|^8.0|^8.1

### Community

Maintainers

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

---

Top Contributors

[![dcsg](https://avatars.githubusercontent.com/u/744921?v=4)](https://github.com/dcsg "dcsg (10 commits)")

---

Tags

phpphp-librarystring-manipulationstring-templatestring manipulationstringystring template

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[opis/string

Multibyte strings as objects

7420.9M7](/packages/opis-string)[andreas-glaser/php-helpers

A comprehensive collection of PHP utility functions for array manipulation, string operations, date handling, HTML generation, form building, validation, and more. Modern PHP 8.2+ library with full type safety.

1386.5k2](/packages/andreas-glaser-php-helpers)[tcb13/substringy

A sub string manipulation library with multibyte support that extends Stringy

1760.6k1](/packages/tcb13-substringy)

PHPackages © 2026

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