Slide 39
Slide 39 text
$handlers = new HandlerContainer();
$handlers->add('foo', function(ShortcodeInterface $s) {
return ''.$s->getContent().'';
});
$handlers->add('inner', function(ShortcodeInterface $s) {
return date('Y.m.d');
});
$processor = new Processor(new RegularParser(), $handlers);
$text = '[foo arg=val] data [inner=x /] code [/foo]';
$expected = ' data 2017.04.03 code ';
assert($expected === $processor->process($text));