mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
feat: add Liquid filters 'sample', 'days_ago'
This commit is contained in:
parent
2eee024b36
commit
f38ac778f1
5 changed files with 117 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ namespace App\Models;
|
|||
|
||||
use App\Liquid\FileSystems\InlineTemplatesFileSystem;
|
||||
use App\Liquid\Filters\Data;
|
||||
use App\Liquid\Filters\Date;
|
||||
use App\Liquid\Filters\Localization;
|
||||
use App\Liquid\Filters\Numbers;
|
||||
use App\Liquid\Filters\StringMarkup;
|
||||
|
|
@ -215,6 +216,7 @@ class Plugin extends Model
|
|||
{
|
||||
$replacements = [
|
||||
'date: "%N"' => 'date: "u"',
|
||||
'date: "%u"' => 'date: "u"',
|
||||
'%-m/%-d/%Y' => 'm/d/Y',
|
||||
];
|
||||
|
||||
|
|
@ -271,11 +273,12 @@ class Plugin extends Model
|
|||
);
|
||||
|
||||
// Register all custom filters
|
||||
$environment->filterRegistry->register(Numbers::class);
|
||||
$environment->filterRegistry->register(Data::class);
|
||||
$environment->filterRegistry->register(Date::class);
|
||||
$environment->filterRegistry->register(Localization::class);
|
||||
$environment->filterRegistry->register(Numbers::class);
|
||||
$environment->filterRegistry->register(StringMarkup::class);
|
||||
$environment->filterRegistry->register(Uniqueness::class);
|
||||
$environment->filterRegistry->register(Localization::class);
|
||||
|
||||
// Register the template tag for inline templates
|
||||
$environment->tagRegistry->register(TemplateTag::class);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue