Skip to content
Permalink
Browse files

[generate:plugin:fieldwidget] Add schema file (#4116)

* [generate:plugin:fieldwidget] Add schema file

* [generate:plugin:fieldwidget] Add annotation module name
  • Loading branch information...
harold20 authored and enzolutions committed Jul 29, 2019
1 parent 57931ca commit 8f812649c02b646dad464fe8f50db68ab6355fc1
@@ -37,10 +37,19 @@ public function generate(array $parameters)
$module = $parameters['module'];
$class_name = $parameters['class_name'];
$moduleInstance = $this->extensionManager->getModule($module);
$this->renderFile(
'module/src/Plugin/Field/FieldWidget/fieldwidget.php.twig',
$this->extensionManager->getPluginPath($module, 'Field/FieldWidget') . '/' . $class_name . '.php',
$parameters
);
$this->renderFile(
'module/schema.yml.twig',
$moduleInstance->getPath() . '/' . $module . '.schema.yml',
$parameters,
FILE_APPEND
);
}
}
@@ -0,0 +1,10 @@
field.widget.settings.{{ plugin_id }}:
type: mapping
label: '{{ label }} widget settings'
mapping:
size:
type: integer
label: 'Size'
placeholder:
type: textfield
label: 'Placeholder'
@@ -20,6 +20,7 @@ use Drupal\Core\Form\FormStateInterface;
*
* @FieldWidget(
* id = "{{ plugin_id }}",
* module = "{{ module }}"
* label = @Translation("{{ label }}"){% if field_type %},
* field_types = {
* "{{ field_type }}"

0 comments on commit 8f81264

Please sign in to comment.
You can’t perform that action at this time.