mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 21:13:57 +00:00
[chill entity render] fix usage of default entity rendering
This commit is contained in:
@@ -33,7 +33,7 @@ class ChillEntityRender extends AbstractChillEntityRender
|
||||
|
||||
public function renderString($entity, array $options): string
|
||||
{
|
||||
return $entity;
|
||||
return (string) $entity;
|
||||
}
|
||||
|
||||
public function supports($entity, array $options): bool
|
||||
|
@@ -41,6 +41,11 @@ class ChillEntityRenderExtension extends AbstractExtension
|
||||
*/
|
||||
protected $defaultRender;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->defaultRender = new ChillEntityRender();
|
||||
}
|
||||
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
@@ -55,12 +60,20 @@ class ChillEntityRenderExtension extends AbstractExtension
|
||||
|
||||
public function renderString($entity, array $options = []): string
|
||||
{
|
||||
if (NULL === $entity) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->getRender($entity, $options)
|
||||
->renderString($entity, $options);
|
||||
}
|
||||
|
||||
public function renderBox($entity, array $options = []): string
|
||||
{
|
||||
if (NULL === $entity) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->getRender($entity, $options)
|
||||
->renderBox($entity, $options);
|
||||
}
|
||||
|
Reference in New Issue
Block a user