Skip to content

tdomarkas/string-decorator-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

String decorator for PHP

Decorate your string with indexed callbacks:

$compositeDecorator = StringDecorator::create('foo bar baz');
$compositeDecorator->apply(4, 7, HtmlTagDecorator::create('strong'));
$compositeDecorator->apply(0, 7, HtmlTagDecorator::create('em'));
$compositeDecorator->render(); // => "<em>foo </em><strong><em>bar</em></strong> baz"

You can apply your own decorators by implementing DecoratorInterface.

This is an early release. Don't use in production.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages