aboutsummaryrefslogtreecommitdiffhomepage
path: root/main/app/sprinkles/FormGenerator/src/Element/Textarea.php
diff options
context:
space:
mode:
Diffstat (limited to 'main/app/sprinkles/FormGenerator/src/Element/Textarea.php')
-rwxr-xr-xmain/app/sprinkles/FormGenerator/src/Element/Textarea.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/main/app/sprinkles/FormGenerator/src/Element/Textarea.php b/main/app/sprinkles/FormGenerator/src/Element/Textarea.php
new file mode 100755
index 0000000..bec3a6c
--- /dev/null
+++ b/main/app/sprinkles/FormGenerator/src/Element/Textarea.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * UF Form Generator
+ *
+ * @link https://github.com/lcharette/UF_FormGenerator
+ * @copyright Copyright (c) 2017 Louis Charette
+ * @license https://github.com/lcharette/UF_FormGenerator/blob/master/LICENSE (MIT License)
+ */
+namespace UserFrosting\Sprinkle\FormGenerator\Element;
+
+use UserFrosting\Sprinkle\FormGenerator\Element\BaseInput;
+
+/**
+ * Textarea input type class.
+ * Manage the default attributes required to display a textarea input
+ *
+ * @extends BaseInput
+ */
+class Textarea extends BaseInput {
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function applyTransformations()
+ {
+ $this->element = array_merge([
+ "autocomplete" => "off",
+ "class" => "form-control",
+ "value" => $this->getValue(),
+ "name" => $this->name,
+ "rows" => 3,
+ "id" => "field_" . $this->name
+ ], $this->element);
+
+ // Translate placeholder
+ $this->translateArgValue('placeholder');
+ }
+}