generate:plugin:condition

Criar um plugin de condition.

Utilização:

drupal generate:plugin:condition [options]
gpco

Opções disponíveis

Opção Detalhes
--module O nome do módulo.
--class Nome da classe do plugin
--label Label do plugin
--plugin-id Id do plugin
--context-definition-id ID da definição de contexto
--context-definition-label Label da definição de contexto
--context-definition-required A definição de contexto é obrigatória (TRUE/FALSE)

Exemplos

  • Generate a plugin condition for a node entity type specifying the module name, the class, the label, its id and the context definition
    drupal generate:plugin:condition  \
    --module="modulename"  \
    --class="ExampleCondition"  \
    --label="Example condition"  \
    --plugin-id="example_condition"  \
    --context-definition-id="entity:node"  \
    --context-definition-label="node"  \
    --context-definition-required
    
  • Generate a plugin condition for language specifying the module name, the class, the label, its id and the context definition
    drupal generate:plugin:condition  \
    --module="modulename"  \
    --class="ExampleCondition"  \
    --label="Example condition"  \
    --plugin-id="example_condition"  \
    --context-definition-id="language"  \
    --context-definition-label="Language"  \
    --context-definition-required
    
  • Generate a plugin condition for role configuration specifying the module name, the class, the label, its id and the context definition
    drupal generate:plugin:condition  \
    --module="modulename"  \
    --class="ExampleCondition"  \
    --label="Example condition"  \
    --plugin-id="example_condition"  \
    --context-definition-id="entity:user_role"  \
    --context-definition-label="user_role"  \
    --context-definition-required