Method | Description | |
---|---|---|
__construct ( Thunder\Shortcode\Parser\ParserInterface $parser, Thunder\Shortcode\HandlerContainer\HandlerContainerInterface $handlers ) | automatically process shortcode content | |
process ( string $text ) : string | Entry point for shortcode processing. Implements iterative algorithm for both limited and unlimited number of iterations. | |
withAutoProcessContent ( boolean $flag ) : self | Whether shortcode content will be automatically processed and handler already receives shortcode with processed content. If false, every shortcode handler needs to process content on its own. Default true. | |
withEventContainer ( Thunder\Shortcode\EventContainer\EventContainerInterface $eventContainer ) : self | Container for event handlers used in this processor. | |
withMaxIterations ( integer | null $iterations ) : self | Maximum number of iterations, null means infinite, any integer greater than zero sets value. Zero is invalid because there must be at least one iteration. Defaults to 1. Loop breaks if result of two consequent iterations shows no change in processed text. | |
withRecursionDepth ( integer | null $depth ) : self | Recursion depth level, null means infinite, any integer greater than or equal to zero sets value (number of recursion levels). Zero disables recursion. Defaults to null. |
Method | Description | |
---|---|---|
applyReplaces ( $text, array $replaces ) | ||
dispatchEvent ( $name, $event ) | ||
processHandler ( Thunder\Shortcode\Shortcode\ParsedShortcodeInterface $parsed, Thunder\Shortcode\Processor\ProcessorContext $context, $handler ) | ||
processIteration ( $text, Thunder\Shortcode\Processor\ProcessorContext $context, Thunder\Shortcode\Shortcode\ProcessedShortcode $parent = null ) | ||
processRecursion ( Thunder\Shortcode\Shortcode\ParsedShortcodeInterface $shortcode, Thunder\Shortcode\Processor\ProcessorContext $context ) |
public __construct ( Thunder\Shortcode\Parser\ParserInterface $parser, Thunder\Shortcode\HandlerContainer\HandlerContainerInterface $handlers ) | ||
$parser | Thunder\Shortcode\Parser\ParserInterface | |
$handlers | Thunder\Shortcode\HandlerContainer\HandlerContainerInterface |
public withAutoProcessContent ( boolean $flag ) : self | ||
$flag | boolean | True if enabled (default), false otherwise |
return | self |
public withEventContainer ( Thunder\Shortcode\EventContainer\EventContainerInterface $eventContainer ) : self | ||
$eventContainer | Thunder\Shortcode\EventContainer\EventContainerInterface | |
return | self |
public withMaxIterations ( integer | null $iterations ) : self | ||
$iterations | integer | null | |
return | self |
public withRecursionDepth ( integer | null $depth ) : self | ||
$depth | integer | null | |
return | self |