ExtraFieldComponent.php in Flexiform 8
File
src/Plugin/FormComponentType/ExtraFieldComponent.php
View source
<?php
namespace Drupal\flexiform\Plugin\FormComponentType;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\RendererInterface;
use Drupal\flexiform\FormComponent\FormComponentBase;
class ExtraFieldComponent extends FormComponentBase {
protected $extraField;
public function setExtraField(array $extra_field) {
$this->extraField = $extra_field;
}
public function render(array &$form, FormStateInterface $form_state, RendererInterface $renderer) {
}
public function extractFormValues(array $form, FormStateInterface $form_state) {
}
public function settingsForm(array $form, FormStateInterface $form_state) {
return [];
}
public function settingsSummary() {
return [];
}
public function settingsFormSubmit($values, array $form, FormStateInterface $form_state) {
return [];
}
public function getAdminLabel() {
if (count($this
->getFormEntityManager()
->getFormEntities()) > 1) {
return $this->extraField['label'] . ' [' . $this
->getFormEntityManager()
->getFormEntity('')
->getFormEntityContextDefinition()
->getLabel() . ']';
}
return $this->extraField['label'];
}
}