1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-28 23:40:41 +02:00

feat(macros): add php macros for entries

This commit is contained in:
Awilum
2022-05-09 07:44:17 +03:00
parent ee9520eb7c
commit 7d610f0a0e
5 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
title: Blog
macros:
php: |
$entry = entries()->registry()->get('methods.fetch');
$entry['result']['posts'] = entries()->fetch('blog', ['collection' => true, 'filter' => ['sort_by' => ['key' => 'date', 'direction' => 'ASC']]])->toArray();
entries()->registry()->set('methods.fetch', $entry);

View File

@@ -85,6 +85,9 @@ entries:
path: "/src/flextype/core/Entries/Directives/TypesDirective.php"
macros:
debug: false
php:
enabled: true
path: "/src/flextype/core/Entries/Macros/PhpMacros.php"
registry:
enabled: true
path: "/src/flextype/core/Entries/Macros/RegistryMacros.php"