wiki-grav/plugins/shortcode-core/classes/shortcodes/SectionShortcode.php
2023-06-02 08:07:58 +02:00

17 lines
490 B
PHP

<?php
namespace Grav\Plugin\Shortcodes;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
class SectionShortcode extends Shortcode
{
public function init()
{
$this->shortcode->getHandlers()->add('section', function(ShortcodeInterface $sc) {
$name = $sc->getParameter('name');
$object = new \Grav\Plugin\ShortcodeCore\ShortcodeObject($name, $sc->getContent());
$this->shortcode->addObject($sc->getName(), $object);
});
}
}