1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-20 20:01:37 +02:00

feat(core): update Forms methods #218 #186

This commit is contained in:
Awilum
2019-08-25 12:45:17 +03:00
parent 1389f58202
commit 04b9b6187e

View File

@@ -152,11 +152,11 @@ class Forms
break;
// Media select field
case 'media_select':
//$form_element = Form::select($form_element_name, $this->getMediaList($request->getQueryParams()['id'], false), $form_value, $property['attributes']);
$form_element = Form::select($form_element_name, $this->getMediaList($request->getQueryParams()['id'], false), $form_value, $property['attributes']);
break;
// Simple text-input, for single-line fields.
default:
$form_element = Form::input($form_element_name, $form_value, $property['attributes']);
$form_element = $this->textField($form_element_name, $form_value, $property['attributes']);
break;
}
// Render form elments with labels
@@ -179,6 +179,11 @@ class Forms
return $form;
}
protected function textField($name, $value, $attributes)
{
return Form::input($name, $value, $attributes);
}
protected function _csrfHiddenField()
{
$field = '<input type="hidden" name="' . $this->flextype['csrf']->getTokenNameKey() . '" value="' . $this->flextype['csrf']->getTokenName() . '">';