DuplicateContentForArguments
Each named argument should be passed into the content_for
tag only once.
Anchor to ExamplesExamples
The following examples contain code snippets that either fail or pass this check.
Anchor to ✗ Fail✗ Fail
The following example will fail because it contains two identically named arguments:
{% content_for 'block', type: 'example-block', some_input: 'text', some_input: 'more text' %}
Anchor to ✓ Pass✓ Pass
The following example will pass because the arguments have different names:
{% content_for 'block', type: 'example-block', some_input_1: 'text', some_input_2: 'more text' %}
Anchor to OptionsOptions
The following example contains the default configuration for this check:
DuplicateContentForArguments
enabledtrue
severity warning
Parameter | Description |
---|---|
enabled | Whether this check is enabled. |
severity | The severity of the check. |
Anchor to Disabling this checkDisabling this check
Disabling this check isn't recommended.
Was this page helpful?