create visualisation service rers #268

This commit is contained in:
2014-11-10 12:15:10 +01:00
parent 16308d0139
commit 28862bbdb9
9 changed files with 293 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ use Chill\CustomFieldsBundle\CustomFields\CustomFieldInterface;
use Chill\CustomFieldsBundle\Entity\CustomField;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Bundle\TwigBundle\TwigEngine;
/**
*
@@ -19,9 +20,17 @@ class CustomFieldText implements CustomFieldInterface
private $requestStack;
public function __construct(RequestStack $requestStack)
/**
*
* @var TwigEngine
*/
private $templating;
public function __construct(RequestStack $requestStack, TwigEngine $templating)
{
$this->requestStack = $requestStack;
$this->templating = $templating;
}
const MAX_LENGTH = 'maxLength';
@@ -47,7 +56,8 @@ class CustomFieldText implements CustomFieldInterface
public function render($value, CustomField $customField)
{
return $this->templating
->render('ChillCustomFieldsBundle:CustomFieldsRendering:text.html.twig', array('text' => $value));
}
public function serialize($value, CustomField $customField)