CodeArea

Syntax-highlighted code editor/viewer with copy-to-clipboard, multiple language support, and optional editing.

Read-Only (PHP)

PHP

Read-Only (JavaScript)

JS

Read-Only (SQL)

SQL

Editable

CSS
PHP

PHP PHP Methods (Fluent)

Method / PropertyParametersDescription
$m->codeArea($id)stringCreate a CodeArea component.
->language($lang)stringSyntax language: js, css, sql, php.
->name($name)?stringForm field name for the underlying textarea.
->value($code)stringSet the initial code content.
->readOnly($ro)boolRead-only mode (default: true).
->rows($rows)intVisible row count (default: 8, min: 2).
->wrap($wrap)boolEnable long-line wrapping (default: true).

JS JS Methods

Method / PropertyParametersDescription
m.codearea(id, opts)string, ?objectGet or create CodeArea instance.
value(v)?stringGet or set the code text.
render()Re-run syntax highlighting.
wrap(bool)boolToggle text wrapping.

JS Syntax Token CSS Classes

Method / PropertyParametersDescription
.m-codearea-token-keywordLanguage keywords (function, var, SELECT, etc.).
.m-codearea-token-stringString literals.
.m-codearea-token-commentComments.
.m-codearea-token-numberNumeric literals.
.m-codearea-token-variableVariables (e.g. PHP $var).
.m-codearea-token-constantConstants.