Basic code for an object group select item thing.

This commit is contained in:
James Cole
2020-06-05 19:39:09 +02:00
parent b75178a184
commit c90c181785
3 changed files with 39 additions and 0 deletions

View File

@@ -436,4 +436,33 @@ class ExpandedForm
return $html;
}
/**
* @param null $value
* @param array|null $options
*
* @return string
*/
public function objectGroup($value = null, array $options = null): string
{
$name = 'object_group';
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
$classes = $this->getHolderClasses($name);
$value = $this->fillFieldValue($name, $value);
$options['rows'] = 4;
if (null === $value) {
$value = '';
}
try {
$html = view('form.object_group', compact('classes', 'name', 'label', 'value', 'options'))->render();
} catch (Throwable $e) {
Log::debug(sprintf('Could not render objectGroup(): %s', $e->getMessage()));
$html = 'Could not render objectGroup.';
}
return $html;
}
}