1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-06 05:07:41 +02:00

feat(shortcodes): [strings] shortcode - add camel modifier

This commit is contained in:
Awilum
2022-05-04 22:09:55 +03:00
parent 067fc7a927
commit ed8ca273ad
2 changed files with 7 additions and 0 deletions

View File

@@ -96,6 +96,10 @@ parsers()->shortcodes()->addHandler('strings', static function (ShortcodeInterfa
if ($key == 'between') {
$content = strings($content)->{'between'}(isset($values[0]) ? (string) $values[0] : '', isset($values[1]) ? (string) $values[1] : '')->toString();
}
if ($key == 'camel') {
$content = strings($content)->{'camel'}()->toString();
}
}
return (string) $content;

View File

@@ -49,4 +49,7 @@ test('[strings] shortcode', function () {
// between
$this->assertEquals("b", parsers()->shortcodes()->parse('[strings between=a|c]abc[/strings]'));
// camel
$this->assertEquals("fooBar", parsers()->shortcodes()->parse('[strings camel]foo_bar[/strings]'));
});