# lang-php **Repository Path**: mirrors_codemirror/lang-php ## Basic Information - **Project Name**: lang-php - **Description**: PHP integration for CodeMirror - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-09-05 - **Last Updated**: 2026-02-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # @codemirror/lang-php [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-php.svg)](https://www.npmjs.org/package/@codemirror/lang-php) [ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-php/blob/main/CHANGELOG.md) ] This package implements PHP language support for the [CodeMirror](https://codemirror.net/) code editor. The [project page](https://codemirror.net/) has more information, a number of [examples](https://codemirror.net/examples/) and the [documentation](https://codemirror.net/docs/). This code is released under an [MIT license](https://github.com/codemirror/lang-php/tree/main/LICENSE). We aim to be an inclusive, welcoming community. To make that explicit, we have a [code of conduct](http://contributor-covenant.org/version/1/1/0/) that applies to communication around the project. ## Usage ```javascript import {EditorView, basicSetup} from "codemirror" import {php} from "@codemirror/lang-php" const view = new EditorView({ parent: document.body, doc: ``, extensions: [basicSetup, php()] }) ``` ## API Reference
php(config⁠?: Object = {}) → LanguageSupport

PHP language support.

config
baseLanguage⁠?: Language

By default, the parser will treat content outside of <? and ?> markers as HTML. You can pass a different language here to change that. Explicitly passing disables parsing of such content.

plain⁠?: boolean

By default, PHP parsing only starts at the first <? marker. When you set this to true, it starts immediately at the start of the document.

phpLanguage: LRLanguage

A language provider based on the Lezer PHP parser, extended with highlighting and indentation information.