1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-23 05:16:03 +02:00

feat(core): add field_class for Forms class #218 #186

This commit is contained in:
Awilum
2019-08-27 10:51:31 +03:00
parent e0996bc6fb
commit a55bbda1e6

View File

@@ -51,6 +51,14 @@ class Forms
'12' => 'col-12'
];
/**
* Field class
*
* @var string
* @access private
*/
private $field_class = 'form-control';
/**
* Constructor
*
@@ -101,7 +109,7 @@ class Forms
$property['attributes'] = Arr::keyExists($property, 'attributes') ? $property['attributes'] : [];
// Create attribute class
$property['attributes']['class'] = Arr::keyExists($property, 'attributes.class') ? 'form-control ' . $property['attributes']['class'] : 'form-control';
$property['attributes']['class'] = Arr::keyExists($property, 'attributes.class') ? $this->field_class . ' ' . $property['attributes']['class'] : $this->field_class;
// Create attribute size
$property['size'] = Arr::keyExists($property, 'size') ? $this->sizes[$property['size']] : $this->sizes['12'];