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:
6
tests/fixtures/entries/blog-php-macros/entry.yaml
vendored
Normal file
6
tests/fixtures/entries/blog-php-macros/entry.yaml
vendored
Normal 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);
|
3
tests/fixtures/settings/settings.yaml
vendored
3
tests/fixtures/settings/settings.yaml
vendored
@@ -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"
|
||||
|
Reference in New Issue
Block a user