You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
rdrew 1ff7f47e26 1st 3 weeks ago
..
src 1st 3 weeks ago
tests 1st 3 weeks ago
README.md 1st 3 weeks ago
composer.json 1st 3 weeks ago
devel_generate.batch.inc 1st 3 weeks ago
devel_generate.info.yml 1st 3 weeks ago
devel_generate.module 1st 3 weeks ago
devel_generate.permissions.yml 1st 3 weeks ago
devel_generate.routing.yml 1st 3 weeks ago
devel_generate.services.yml 1st 3 weeks ago

README.md

[[TOC]]

This module may be used to create entities that contain sample content. This is useful when showing off your site to a client, for example. Even if the content is not yet available, the site can show its look and feel and behavior.

The sample entities may be created via the Web or via the included Drush commands like drush genc.

Custom plugins

This module creates the DevelGenerate plugin type.

All you need to do to provide a new instance for DevelGenerate plugin type is to create your class extending DevelGenerateBase and following these steps:

  1. Declare your plugin with annotations:
    /**
     * Provides a ExampleDevelGenerate plugin.
     *
     * @DevelGenerate(
     *   id = "example",
     *   label = @Translation("example"),
     *   description = @Translation("Generate a given number of example elements."),
     *   url = "example",
     *   permission = "administer example",
     *   settings = {
     *     "num" = 50,
     *     "kill" = FALSE,
     *     "another_property" = "default_value"
     *   }
     * )
     */
    
  2. Implement the settingsForm method to create a form using the properties from the annotations.
  3. Implement the handleDrushParams method. It should return an array of values.
  4. Implement the generateElements method. You can write here your business logic using the array of values.

Notes