1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-24 13:52:56 +02:00

- Flextype Core: New Shortcode [registry_get] - added. #165

This commit is contained in:
Awilum
2019-07-01 12:26:36 +03:00
parent afe0aedbe9
commit 6148fb14ce

View File

@@ -0,0 +1,21 @@
<?php
/**
* @package Flextype
*
* @author Sergey Romanenko <hello@romanenko.digital>
* @link http://romanenko.digital
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flextype;
use Thunder\Shortcode\ShortcodeFacade;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
// Shortcode: [registry_get name="item-name" default="default-value"]
$flextype['shortcodes']->addHandler('registry_get', function (ShortcodeInterface $s) use ($flextype) {
return $flextype['registry']->get($s->getParameter('name'), $s->getParameter('default'));
});