Skip to content

Change the validation of the Argument Name field in the ViewModel dialog window #369

Closed
@DmitryFurs

Description

@DmitryFurs

Describe the bug

Currently, we can't use an underscore _ in the argument name, only letters and numbers. The underscore character is not prohibited for use in layouts by Magento, so it must be allowed for use in the dialog window.

To Reproduce

  1. Open any layout file
  2. Right click on the block
  3. Select the Inject a ViewModel... option
  4. Fill in all the input data and use the view_model value for the Argument Name field
  5. Click Ok button

Expected behavior

The View Model is added to the block with the specified name containing the underscore character.

Screenshots

image
image

Please complete the following information:

  • OS: MacOS 10.15.7
  • PhpStorm/Intellij version: 2020.2.3
  • Plugin Version: 2.0.1

Additional context

Here are examples from the Magneto code where underscores are used:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions