Releases: code16/sharp
Releases · code16/sharp
v7.29.5
v7.29.4
v7.29.0
v7.28.0
Features
- Added new
uploads.model_class
config key allowing to declare your ownSharpUploadModel
implementation. This is useful in one particular case: when you choose to customize the views used in the public website for Editor's embedded files (see https://sharp.code16.fr/docs/guide/form-fields/editor.html#display-embedded-files-images-in-the-public-site).
v7.27.1
New feature (well, not really, hence the patch versioning)
- added a few methods on the layout API to allow field insertion:
FormLayout::getColumn($index)
FormLayoutTab::getColumn($index)
LayoutColumn::insertSingleFieldAt($index, $fieldKey)
LayoutColumn::insertFieldsAt($index, ...$fieldKeys)
Usage example, in a inherited Form:
class MyForm extends AnotherExistingForm
{
public function buildFormFields(FieldsContainer $formFields): void
{
parent::buildFormFields($formFields);
$formFields->addField(SharpFormTextField::make('additional_field'));
}
public function buildFormLayout(FormLayout $formLayout): void
{
parent::buildFormLayout($formLayout);
$this->formLayout
->getColumn(0)
->insertSingleFieldAt(0, 'additional_field');
}
}