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

Flextype Core: Snippets API #154

- added ability to access $flextype and $app inside snippets.
- display() method removed.
- exec() method added.
- _display_snippet() method removed.
- _exec_snippet() method added.
- from now we will set prefix bind_ for all variables.
- [snippets] shortcode removed.
- [snppets_fetch] shortcode added.
- SnippetsTwigExtension: snippets_exec() added.
- SnippetsTwigExtension: snippet removed.
This commit is contained in:
Awilum
2019-06-18 15:50:59 +03:00
parent fcb4310f30
commit de756b456f

View File

@@ -16,6 +16,6 @@ use Thunder\Shortcode\ShortcodeFacade;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
// Shortcode: [snippets_fetch id="snippet-name"]
$flextype['shortcodes']->addHandler('snippets', function (ShortcodeInterface $s) use ($flextype) {
$flextype['shortcodes']->addHandler('snippets_fetch', function (ShortcodeInterface $s) use ($flextype) {
return $flextype['snippets']->exec($s->getParameter('id'));
});