Commit 2a734483 by Frédéric

Filter

parent 1cbde7e6
...@@ -40,7 +40,8 @@ class FluxType extends AbstractType ...@@ -40,7 +40,8 @@ class FluxType extends AbstractType
TextType::class, TextType::class,
[ [
'label' => Translator::__('appolo.tourinsoft.code'), 'label' => Translator::__('appolo.tourinsoft.code'),
'required' => false, 'required' => true,
'read_only' => $options['edit_mode'],
'attr' => [ 'attr' => [
'class' => 'form-control' 'class' => 'form-control'
], ],
...@@ -72,7 +73,6 @@ class FluxType extends AbstractType ...@@ -72,7 +73,6 @@ class FluxType extends AbstractType
[ [
'label' => Translator::__('appolo.tourinsoft.content_type'), 'label' => Translator::__('appolo.tourinsoft.content_type'),
'required' => true, 'required' => true,
'read_only' => $options['edit_mode'],
'attr' => [ 'attr' => [
'class' => 'form-control' 'class' => 'form-control'
], ],
......
...@@ -62,17 +62,25 @@ class TourinsoftExtension extends SimpleExtension ...@@ -62,17 +62,25 @@ class TourinsoftExtension extends SimpleExtension
protected function registerTwigFilters() protected function registerTwigFilters()
{ {
return [ return [
'minuscule' => 'minusculeFilter', 'tourinsoft' => 'TourinsoftFilter',
]; ];
} }
/** /**
* @param $input * @param $input
* @return string * @return array
*/ */
public function minusculeFilter($input) public function TourinsoftFilter($input)
{ {
return strtolower($input); dump($input);
$data = [];
$lines = explode('|', $input);
foreach ($lines as $k => $line) {
$data[$k] = explode('#', $line);
}
return $data;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment