17 lines
490 B
PHP
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);
|
|
});
|
|
|
|
}
|
|
} |