mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +00:00
render_box address: new options and render modes
This commit is contained in:
@@ -10,16 +10,20 @@ class AddressRender implements ChillEntityRenderInterface
|
||||
private EngineInterface $templating;
|
||||
|
||||
public const DEFAULT_OPTIONS = [
|
||||
'with_valid_from' => true,
|
||||
'with_valid_from' => false,
|
||||
'with_valid_to' => false,
|
||||
'with_picto' => false,
|
||||
'with_delimiter' => false,
|
||||
'has_no_address' => false,
|
||||
'multiline' => true,
|
||||
'extended_infos' => false
|
||||
];
|
||||
|
||||
public function __construct(EngineInterface $templating)
|
||||
{
|
||||
$this->templating = $templating;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@@ -56,11 +60,12 @@ class AddressRender implements ChillEntityRenderInterface
|
||||
*/
|
||||
public function renderBox($addr, array $options): string
|
||||
{
|
||||
$options = \array_merge(self::DEFAULT_OPTIONS, $options);
|
||||
$options = \array_merge(self::DEFAULT_OPTIONS, $options);
|
||||
|
||||
return $this->templating
|
||||
->render('@ChillMain/Address/entity_render.html.twig', [
|
||||
->render('@ChillMain/Entity/address.html.twig', [
|
||||
'address' => $addr,
|
||||
'render' => $options['render'] ?? 'bloc',
|
||||
'options' => $options
|
||||
]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user