Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to textarea setup #8

Merged
merged 1 commit into from
May 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions src/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,10 @@ private function markupField(FormBuilder $formBuilder)
case "ignore":
// do not render this field at all
return '';
break;

case "checkbox":

return Field::checkbox($this->fieldNameWithBrackets, $this->options, $this->value, $this->asFormArray(Column::WITH_LABEL));
break;

case "checkboxes":

Expand All @@ -255,7 +253,7 @@ private function markupField(FormBuilder $formBuilder)
}

return $output;
break;

case "checkboxes-readonly": /* Render text into the form and add hidden fields */

$attributes = $this->asFormArray(Column::WITH_LABEL);
Expand All @@ -276,7 +274,6 @@ private function markupField(FormBuilder $formBuilder)
$output .= '</div>' . PHP_EOL;

return $output;
break;

case "select":

Expand All @@ -298,12 +295,10 @@ private function markupField(FormBuilder $formBuilder)
}

return Form::select($fieldName, $this->options, $values, $attributes);
break;

case "radios":

return Form::{$this->type}($this->fieldNameWithBrackets, $this->options, $this->value, $this->asFormArray());
break;

case "option-table":
// define table headers from first row
Expand Down Expand Up @@ -346,7 +341,6 @@ private function markupField(FormBuilder $formBuilder)
case "file":

return Field::file($this->fieldNameWithBrackets, $this->asFormArray());
break;

case "date":

Expand Down Expand Up @@ -377,7 +371,6 @@ private function markupField(FormBuilder $formBuilder)

// We create date as a text field (NOT date!) because we replace it with a date picker and don't want Chrome to be "helpful"
return Field::text($this->fieldNameWithBrackets, $this->value, $this->asFormArray());
break;

case "date-readonly": /* Render text into the form and add a hidden field */

Expand All @@ -398,7 +391,6 @@ private function markupField(FormBuilder $formBuilder)
case "password":

return Form::bsPassword($this->fieldNameWithBrackets, $this->value, $this->asFormArray());
break;

case "radios-readonly": /* Render text into the form and add a hidden field */
case "select-readonly": /* Render text into the form and add a hidden field */
Expand Down Expand Up @@ -495,12 +487,14 @@ private function markupField(FormBuilder $formBuilder)
case "search":

return Form::text($this->fieldNameWithBrackets, $this->value, $this->asFormArray());
break;

case 'textarea':

return Field::{$this->type}($this->fieldNameWithBrackets, htmlspecialchars($this->value), $this->asFormArray());

default:

return Field::{$this->type}($this->fieldNameWithBrackets, $this->value, $this->asFormArray());
break;
}

return $output;
Expand Down