1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-18 19:01:40 +02:00

Flextype Core & Flextype Admin Panel: Snippets #165

- Snippets fetch changed to exec
This commit is contained in:
Awilum
2019-07-01 12:04:04 +03:00
parent 17f967dfa6
commit afe0aedbe9
2 changed files with 4 additions and 4 deletions

View File

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

View File

@@ -68,7 +68,7 @@
<div class="modal-body">
<label for="shortcode">{{ tr('admin_shortcode') }}</label>
<div class="alert alert-dark clipboard" role="alert">
<span id="snippet">[snippets_fetch id="<span class="js-snippets-snippet-placeholder"></span>"]</span>
<span id="snippet">[snippets_exec id="<span class="js-snippets-snippet-placeholder"></span>"]</span>
<button class="js-clipboard-btn btn" data-clipboard-target="#snippet">
{{ tr('admin_copy') }}
</button>
@@ -76,7 +76,7 @@
<br>
<label for="template_code">{{ tr('admin_template_code') }}</label>
<div id="template_code" class="alert alert-dark clipboard" role="alert">
<span id="html">&lcub;&lcub; snippets_exec('<span class="js-snippets-php-placeholder"></span>') &rcub;&rcub;</span>
<span id="html">&lcub;&lcub; snippets.exec('<span class="js-snippets-php-placeholder"></span>') &rcub;&rcub;</span>
<button class="js-clipboard-btn btn" data-clipboard-target="#html">
{{ tr('admin_copy') }}
</button>