# Language Injection Settings: Generic PHP

> **TL;DR**
> `File | Settings | Language Injection - Generic PHP` for Windows and Linux
>
>
>
> `IntelliJ IDEA | Settings | Language Injection - Generic PHP` for macOS
>
>
>
> `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.settings.svg)

The dialog opens when you click ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg)   in the [Language Injection](language-injections-settings.html) page, and choose Generic PHP  from the context menu, or select an entry and click ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.edit.svg).

| Item | Description |
| --- | --- |
| Name | The name of the injection. |
| Language |    The language to be injected.       * ID: select the ID or the name of the language to be injected.    * Prefix: specify a sequence of characters to be added before the corresponding string value.    * Suffix: specify a sequence of characters to be added after the corresponding string value.     The prefix and suffix are optional.    |
|  Places Patterns  |      In this field,  type the rules that define the context where you want IntelliJ IDEA recognize literals as injections.       > **Note:** > The rules are built from Program Structure Interface Patterns and are actually chained calls of methods of an internal IntelliJ IDEA language. The [Program Structure Interface](psi-viewer.html) shows the structure of a file as IntelliJ IDEA treats it.       Examples:      Inject JavaScript into HTML `on*` event attributes:      ``` xmlAttribute().withLocalName(string().startsWith("on")) ```     Match an XML tag by name with a specific parent:      ``` xmlTag().withLocalName("script").withParent(xmlTag().withLocalName("html")) ```       Multiple patterns       You can define multiple place patterns for a single injection rule. The injection activates if any of the patterns match (they are combined with OR logic). Add each pattern on a separate line.      > **Warning:** > If you are editing a predefined injection rule, the patterns are already specified. They ensure productivity and ease of use. We recommend that you rely on these configurations rather than create new ones.     |
| Advanced |     In this area, optionally  specify additional settings to narrow the context where the injection rule is applicable and thus to enable more fine-grained control over the injection process.         * Value pattern type a regular expression that determines the context to inject the language into. By using the first capturing group of the patterns as the target for injection, you can configure the procedure to have the language injected only into values that match a certain pattern or into multiple parts that match the pattern.    * Single file - If the option is off, the fragments that match the value pattern are treated separately, as different "files" - for example from the fragment editor's viewpoint. If the option is on, the corresponding fragments are all merged together to form a single unit, or "file". Given the value pattern `xxx (.+) yyy (.+) zzz` and the fragment `xxx select * yyy from family zzz`, `select *` and `from family` are treated as two independent fragments (or "files") if the option is off. If the option is on, `select * from family` is treated as a single unit or "file".    |

## How it works

* [Language and reference injections](using-language-injections.html)

## See also

### Concepts

[Language and reference injections](using-language-injections.html)

### Reference

[Language Injections](language-injections-settings.html)

