[crud] clean and add documentation

This commit is contained in:
2020-03-12 22:31:21 +01:00
parent ad3ced9683
commit 13e81b3b49
5 changed files with 465 additions and 150 deletions

View File

@@ -43,14 +43,6 @@ class TwigCRUDResolver extends AbstractExtension
$this->resolver = $resolver;
}
public function getFilters()
{
return [
new TwigFilter('chill_crud_display', [$this, 'display'],
['needs_environment' => true, 'is_safe' => ['html']])
];
}
public function getFunctions()
{
return [
@@ -59,14 +51,6 @@ class TwigCRUDResolver extends AbstractExtension
];
}
public function display(Environment $env, $entity, $path): string
{
$data = $this->resolver->getData($entity, $path);
$template = $this->resolver->getTwigTemplate($entity, $path);
return $env->render($template, ['data' => $data, 'entity' => $entity, ]);
}
public function getConfig($configKey, $crudName, $action = null)
{
return $this->resolver->getConfigValue($configKey, $crudName, $action);