Updated Inputs

This commit is contained in:
Florian Bouillon 2019-04-17 21:16:00 +02:00
parent ee266e719f
commit 28de4669fe
4 changed files with 19 additions and 2 deletions

View File

@ -12,4 +12,9 @@ class ChoiceInput extends TextInput
'choices' 'choices'
); );
} }
public function getTemplate(): string
{
return "@AdminPanel/form/choice.twig";
}
} }

View File

@ -11,4 +11,9 @@ class DateInput extends TextInput
'value', 'value',
); );
} }
public function getTemplate(): string
{
return "@AdminPanel/form/date.twig";
}
} }

View File

@ -18,6 +18,13 @@ class TextInput implements Input
public function getTemplate(): string public function getTemplate(): string
{ {
return "@AdminPanel/form/text.twig"; $tpName = strtolower(
str_replace(
"Input",
"",
str_split('\\', self::class)[1]
)
);
return "@AdminPanel/form/" . $tpName . ".twig";
} }
} }

View File

@ -4,7 +4,7 @@
<label for="{{name}}">{{label}}</label> <label for="{{name}}">{{label}}</label>
{% endif %} {% endif %}
<input type="text" name="{{name}}" id="{{name}}" list="{{name}}_list"&nbsp;{% for index, item in attr %}{{index}}="{{item}}"&nbsp;{% endfor %}/> <input type="text" name="{{name}}" id="{{name}}" list="{{name}}_list" {% for index, item in attr %}{{index}}="{{item}}" {% endfor %}/>
<datalist id="{{name}}_list"> <datalist id="{{name}}_list">
{% for entity in entities %} {% for entity in entities %}
<option>{{entity.name}}</option> <option>{{entity.name}}</option>