Added missing modules, including some as submodules.
[yaffs-website] / web / modules / contrib / devel / devel_generate / README.txt
1 This module creates the "DevelGenerate" plugin type.
2
3 All you need to do to provide a new instance for "DevelGenerate" plugin type
4 is to create your class extending "DevelGenerateBase" and following the next steps.
5
6 1 - Declaring your plugin with annotations:
7
8 /**
9  * Provides a ExampleDevelGenerate plugin.
10  *
11  * @DevelGenerate(
12  *   id = "example",
13  *   label = @Translation("example"),
14  *   description = @Translation("Generate a given number of example elements. Optionally delete current example elements."),
15  *   url = "example",
16  *   permission = "administer example",
17  *   settings = {
18  *     "num" = 50,
19  *     "kill" = FALSE,
20  *     "another_property" = "default_value"
21  *   }
22  * )
23  */
24
25 2 - Implement "settingsForm" method to create a form using the properties from annotations.
26
27 3 - Implement "handleDrushParams" method. It should return an array of values.
28
29 4 - Implement "generateElements" method. You can write here your business logic
30 using the array of values.
31
32 Notes:
33
34 You can alter existing properties for every plugin implementing hook_devel_generate_info_alter.
35
36 DevelGenerateBaseInterface details base wrapping methods that most DevelGenerate implementations
37 will want to directly inherit from Drupal\devel_generate\DevelGenerateBase.
38
39 To give support for a new field type the field type base class should properly
40 implements \Drupal\Core\Field\FieldItemInterface::generateSampleValue().
41 Devel generate automatically use the values returned by this method during the
42 generate process for generate placeholder field values. For more information
43 see:
44 https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Field%21FieldItemInterface.php/function/FieldItemInterface::generateSampleValue