• Full name: \App\Shared\Services\Shortcode\ShortcodeRegistry

Properties

shortcodes

protected \App\Shared\Services\Shortcode\Shortcode[] $shortcodes

context

protected array $context

allowUnsafeHtml

protected bool $allowUnsafeHtml

Methods

__construct

public __construct(array $context = [], bool $allowUnsafeHtml = false): mixed

Parameters:

Parameter Type Description
$context array
$allowUnsafeHtml bool

allowUnsafeHtml

public allowUnsafeHtml(bool $allowed): void

Parameters:

Parameter Type Description
$allowed bool

register

public register(\App\Shared\Services\Shortcode\Shortcode $shortcode): void

Parameters:

Parameter Type Description
$shortcode \App\Shared\Services\Shortcode\Shortcode

render

public render(string $content): string

Parameters:

Parameter Type Description
$content string

renderShortcodes

protected renderShortcodes(string $content): string

Parameters:

Parameter Type Description
$content string

parseAttributes

protected parseAttributes(string $text): array

Parameters:

Parameter Type Description
$text string

sanitizeOutput

protected sanitizeOutput(string $output): string

Parameters:

Parameter Type Description
$output string

Throws:


shouldRender

protected shouldRender(array $attrs): bool

Parameters:

Parameter Type Description
$attrs array

evaluateCondition

protected evaluateCondition(string $expression): bool

Parameters:

Parameter Type Description
$expression string