Skip to content

Commit 37a0b8b

Browse files
#16 Fix context field on nested array
1 parent 55f982e commit 37a0b8b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/Admin/Field/ContextField.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the CleverAge/UiProcessBundle package.
7+
*
8+
* Copyright (c) Clever-Age
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
namespace CleverAge\UiProcessBundle\Admin\Field;
15+
16+
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
17+
use EasyCorp\Bundle\EasyAdminBundle\Field\FieldTrait;
18+
19+
class ContextField implements FieldInterface
20+
{
21+
use FieldTrait;
22+
23+
public static function new(string $propertyName, ?string $label = null): self
24+
{
25+
return (new self())
26+
->setProperty($propertyName)
27+
->setLabel($label)
28+
->setTemplatePath('@CleverAgeUiProcess/admin/field/array.html.twig');
29+
}
30+
}

0 commit comments

Comments
 (0)