addStyle

Availability: >= 3.0

Type: Object Property

Description: Adds a style to the style menu.

Syntax:

$editor->addStyle string $tagstring $label );

Parameters:

$tag
An HTML tag name followed by optional attributes. When this item is selected from the menu it will wrap the selection in the specified tag and add the specified attributes. The special tag name of *block* indicates that the attributes should be applied to any block level element rather than a specific one.

$label
Label to appear on the menu.

Example:

$editor->addStyle('span class="highlight"''Highlighted');

See also:

stylesMenu, removeStyle, clearStylesMenu