quanzo/x51-shortcode

Implementation shortcodes

1.0.0 2019-08-31 08:31 UTC

This package is auto-updated.

Last update: 2024-04-29 04:19:34 UTC


README

Add

$shortcodes = \x51\classes\shortcode\Shortcode::getInstance();
$shortcodes->add('bold', function ($arParams, $content = ''){
    return '<strong>'.$content.'</strong>';
});

Processing

echo $shortcodes->process($content);

Remove

$shortcodes->remove('bold');
$shortcodes->clear();

Exist

if ($shortcodes->exists('bold')) {
....
}