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:
@@ -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;
|
||||
|
@@ -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]'));
|
||||
|
||||
});
|
Reference in New Issue
Block a user