Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Latest commit

 

History

History
54 lines (51 loc) · 1.74 KB

generate-plugin-condition.md

File metadata and controls

54 lines (51 loc) · 1.74 KB

generate:plugin:condition

Tạo một plugin condition.

Usage:

drupal generate:plugin:condition [options]
gpco

Available options

Option Details
--module Tên module.
--class Tên lớp plugin condition
--label Nhãn Plugin condition
--plugin-id Plugin condition id
--context-definition-id Context definition ID
--context-definition-label Nhãn Context definition
--context-definition-required Yêu cầu Context definition (TRUE/FALSE)

Examples

  • 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