\Kendo\UI\Editor

A PHP wrapper for Kendo UI Editor.

Inherits from \Kendo\UI\Widget.

Usage

To use Editor in a PHP page instantiate a new instance, configure it via the available configuration methods and output it by echo-ing the result of the render method.

Using Kendo Editor

<?php
// Create a new instance of Editor and specify its id
$editor = new \Kendo\UI\Editor('Editor');

// Configure it
$editor->domain('value')

// Output it

echo $editor->render();
?>

Methods

change

Fires when Editor is blurred and its content has changed. For additional information check the change event documentation.

Returns

\Kendo\UI\Editor

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->change('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onChange(e) {
        // handle the change event.
    }
</script>
<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->change('onChange');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->change(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

content

Sets the HTML content of the Editor.

Returns

Editor

$value string

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->content('<strong>Content</strong>');
?>

deserialization

Fine-tune deserialization in the Editor widget. Deserialization is the process of parsing the HTML string input from the value() method or from the viewHtml dialog into editable content.

Returns

\Kendo\UI\Editor

Parameters

$value \Kendo\UI\EditorDeserialization|array

Example - using \Kendo\UI\EditorDeserialization

<?php
$editor = new \Kendo\UI\Editor('Editor');
$deserialization = new \Kendo\UI\EditorDeserialization();
$custom = new \Kendo\JavaScriptFunction('function() { }');
$deserialization->custom($custom);
$editor->deserialization($deserialization);
?>

Example - using array

<?php
$editor = new \Kendo\UI\Editor('Editor');
$custom = new \Kendo\JavaScriptFunction('function() { }');
$editor->deserialization(array('custom' => $custom));
?>

domain

Relaxes the same-origin policy when using the iframe-based editor. This is done automatically for all cases except when the policy is relaxed by document.domain = document.domain. In that case, this property must be used to allow the editor to function properly across browsers. This property has been introduced in internal builds after 2014.1.319.

Returns

\Kendo\UI\Editor

Parameters

$value string

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->domain('value');
?>

encoded

Indicates whether the Editor should submit encoded HTML tags. By default, the submitted value is encoded.

Returns

\Kendo\UI\Editor

Parameters

$value boolean

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->encoded(true);
?>

endContent

Stops output bufferring and sets the preceding markup as the content of the Editor.

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->startContent();
?>
<strong>Content</strong>
<?php
$editor->endContent(); // content is set to <strong>Content</strong>
?>

execute

Fires when an Editor command is executed. For additional information check the execute event documentation.

Returns

\Kendo\UI\Editor

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->execute('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onExecute(e) {
        // handle the execute event.
    }
</script>
<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->execute('onExecute');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->execute(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

fileBrowser

Configuration for file browser dialog.

Returns

\Kendo\UI\Editor

Parameters

$value \Kendo\UI\EditorFileBrowser|array

Example - using \Kendo\UI\EditorFileBrowser

<?php
$editor = new \Kendo\UI\Editor('Editor');
$fileBrowser = new \Kendo\UI\EditorFileBrowser();
$fileTypes = 'value';
$fileBrowser->fileTypes($fileTypes);
$editor->fileBrowser($fileBrowser);
?>

Example - using array

<?php
$editor = new \Kendo\UI\Editor('Editor');
$fileTypes = 'value';
$editor->fileBrowser(array('fileTypes' => $fileTypes));
?>

formattingMarksRefreshDelay

The delay in milliseconds before the formatting marks are refreshed. This feature is useful for performance optimization as the formatting marks are re-rendered any time the user presses a key. If the user is typing very fast or holding down a key, the delay will prevent the re-rendering from being executed multiple times.The visual effect from this configuration is that the marks will briefly disappear while the user is typing. You can set the value to false to fully turn off this behavior.

Returns

\Kendo\UI\Editor

Parameters

$value float|boolean

Example - using float

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->formattingMarksRefreshDelay(1);
?>

Example - using boolean

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->formattingMarksRefreshDelay(true);
?>

imageBrowser

Configuration for image browser dialog.

Returns

\Kendo\UI\Editor

Parameters

$value \Kendo\UI\EditorImageBrowser|array

Example - using \Kendo\UI\EditorImageBrowser

<?php
$editor = new \Kendo\UI\Editor('Editor');
$imageBrowser = new \Kendo\UI\EditorImageBrowser();
$fileTypes = 'value';
$imageBrowser->fileTypes($fileTypes);
$editor->imageBrowser($imageBrowser);
?>

Example - using array

<?php
$editor = new \Kendo\UI\Editor('Editor');
$fileTypes = 'value';
$editor->imageBrowser(array('fileTypes' => $fileTypes));
?>

immutables

If enabled, the editor disables the editing and command execution in elements marked with editablecontent="false" attribute.

Returns

\Kendo\UI\Editor

Parameters

$value boolean|\Kendo\UI\EditorImmutables|array

Example - using boolean

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->immutables(true);
?>

Example - using \Kendo\UI\EditorImmutables

<?php
$editor = new \Kendo\UI\Editor('Editor');
$immutables = new \Kendo\UI\EditorImmutables();
$serialization = 'value';
$immutables->serialization($serialization);
$editor->immutables($immutables);
?>

Example - using array

<?php
$editor = new \Kendo\UI\Editor('Editor');
$serialization = 'value';
$editor->immutables(array('serialization' => $serialization));
?>

inlineHeight

This property enables you to configure height for the Editor when the component is in inline mode.

Returns

\Kendo\UI\Editor

Parameters

$value float

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->inlineHeight(1);
?>

keydown

Fires when the user depresses a keyboard key. Triggered multiple times if the user holds the key down. For additional information check the keydown event documentation.

Returns

\Kendo\UI\Editor

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->keydown('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onKeydown(e) {
        // handle the keydown event.
    }
</script>
<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->keydown('onKeydown');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->keydown(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

keyup

Fires when the user releases a keyboard key. For additional information check the keyup event documentation.

Returns

\Kendo\UI\Editor

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->keyup('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onKeyup(e) {
        // handle the keyup event.
    }
</script>
<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->keyup('onKeyup');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->keyup(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

messages

Defines the text of the labels that are shown within the editor. Used primarily for localization.

Returns

\Kendo\UI\Editor

Parameters

$value \Kendo\UI\EditorMessages|array

Example - using \Kendo\UI\EditorMessages

<?php
$editor = new \Kendo\UI\Editor('Editor');
$messages = new \Kendo\UI\EditorMessages();
$accessibilityTab = 'value';
$messages->accessibilityTab($accessibilityTab);
$editor->messages($messages);
?>

Example - using array

<?php
$editor = new \Kendo\UI\Editor('Editor');
$accessibilityTab = 'value';
$editor->messages(array('accessibilityTab' => $accessibilityTab));
?>

If set to true this configuration option would enable Tab-based navigation among Editor ToolBar items. By default navigation is arrow-based.

Returns

\Kendo\UI\Editor

Parameters

$value boolean

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->navigateOnTab(true);
?>

addNonSplittableTagsOnPasteItem

Adds one or more EditorNonSplittableTagsOnPasteItem to the Editor.

Returns

\Kendo\UI\Editor

Parameters

$value[, $value2, ...] \Kendo\UI\EditorNonSplittableTagsOnPasteItem|array

Example - using \Kendo\UI\EditorNonSplittableTagsOnPasteItem

<?php
$editor = new \Kendo\UI\Editor('Editor');
$nonSplittableTagsOnPasteItem = new \Kendo\UI\EditorNonSplittableTagsOnPasteItem();
$tag = 'value';
$nonSplittableTagsOnPasteItem->tag($tag);
$editor->addNonSplittableTagsOnPasteItem($nonSplittableTagsOnPasteItem);
?>

Example - using array

<?php
$editor = new \Kendo\UI\Editor('Editor');
$tag = 'value';
$editor->addNonSplittableTagsOnPasteItem(array('tag' => $tag));
?>

Example - adding more than one EditorNonSplittableTagsOnPasteItem

<?php
$editor = new \Kendo\UI\Editor('Editor');
$first  = new \Kendo\UI\EditorNonSplittableTagsOnPasteItem();
$second = new \Kendo\UI\EditorNonSplittableTagsOnPasteItem();
$editor->addNonSplittableTagsOnPasteItem($first, $second);
?>

nonce

When strict CSP is enabled a nonce can be provided for the inline styles. The passed value would be used as the nonce attribute for the inline styles in the content area iframe, the placeholder inline style and the link tags loading external stylesheets in the content area.

Returns

\Kendo\UI\Editor

Parameters

$value string

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->nonce('value');
?>

paste

Fires before the content is pasted in the Editor. For additional information check the paste event documentation.

Returns

\Kendo\UI\Editor

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->paste('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onPaste(e) {
        // handle the paste event.
    }
</script>
<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->paste('onPaste');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->paste(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

pasteCleanup

Options for controlling how the pasting content is modified before it is added in the editor.

Returns

\Kendo\UI\Editor

Parameters

$value \Kendo\UI\EditorPasteCleanup|array

Example - using \Kendo\UI\EditorPasteCleanup

<?php
$editor = new \Kendo\UI\Editor('Editor');
$pasteCleanup = new \Kendo\UI\EditorPasteCleanup();
$all = true;
$pasteCleanup->all($all);
$editor->pasteCleanup($pasteCleanup);
?>

Example - using array

<?php
$editor = new \Kendo\UI\Editor('Editor');
$all = true;
$editor->pasteCleanup(array('all' => $all));
?>

pdf

Configures the Kendo UI Editor PDF export settings.

Returns

\Kendo\UI\Editor

Parameters

$value \Kendo\UI\EditorPdf|array

Example - using \Kendo\UI\EditorPdf

<?php
$editor = new \Kendo\UI\Editor('Editor');
$pdf = new \Kendo\UI\EditorPdf();
$author = 'value';
$pdf->author($author);
$editor->pdf($pdf);
?>

Example - using array

<?php
$editor = new \Kendo\UI\Editor('Editor');
$author = 'value';
$editor->pdf(array('author' => $author));
?>

pdfExport

Fired when the user clicks the "Export to PDF" toolbar button. For additional information check the pdfExport event documentation.

Returns

\Kendo\UI\Editor

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->pdfExport('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onPdfExport(e) {
        // handle the pdfExport event.
    }
</script>
<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->pdfExport('onPdfExport');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->pdfExport(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

placeholder

The hint displayed by the widget when it is empty. Not set by default.

Returns

\Kendo\UI\Editor

Parameters

$value string

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->placeholder('value');
?>

resizable

If enabled, the editor renders a resize handle to allow users to resize it.

Returns

\Kendo\UI\Editor

Parameters

$value boolean|\Kendo\UI\EditorResizable|array

Example - using boolean

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->resizable(true);
?>

Example - using \Kendo\UI\EditorResizable

<?php
$editor = new \Kendo\UI\Editor('Editor');
$resizable = new \Kendo\UI\EditorResizable();
$content = true;
$resizable->content($content);
$editor->resizable($resizable);
?>

Example - using array

<?php
$editor = new \Kendo\UI\Editor('Editor');
$content = true;
$editor->resizable(array('content' => $content));
?>

select

Fires when the Editor selection has changed. For additional information check the select event documentation.

Returns

\Kendo\UI\Editor

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->select('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onSelect(e) {
        // handle the select event.
    }
</script>
<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->select('onSelect');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->select(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

serialization

Allows setting of serialization options.

Returns

\Kendo\UI\Editor

Parameters

$value \Kendo\UI\EditorSerialization|array

Example - using \Kendo\UI\EditorSerialization

<?php
$editor = new \Kendo\UI\Editor('Editor');
$serialization = new \Kendo\UI\EditorSerialization();
$entities = true;
$serialization->entities($entities);
$editor->serialization($serialization);
?>

Example - using array

<?php
$editor = new \Kendo\UI\Editor('Editor');
$entities = true;
$editor->serialization(array('entities' => $entities));
?>

startContent

Starts output bufferring. Any following markup will be set as the content of the Editor.

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->startContent();
?>
<strong>Content</strong>
<?php
$editor->endContent(); // content is set to <strong>Content</strong>
?>

stylesheets

Allows custom stylesheets to be included within the editing area. This setting is applicable only when the Editor is initialized from a textarea and a contenteditable iframe is generated.

Returns

\Kendo\UI\Editor

Parameters

$value array

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->stylesheets(array());
?>

tag

The tag that will be rendered. Defaults to "textarea". Triggers the inline edit mode if different.

Returns

\Kendo\UI\Editor

Parameters

$value string

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->tag('value');
?>

addTool

Adds one or more EditorTool to the Editor.

Returns

\Kendo\UI\Editor

Parameters

$value[, $value2, ...] \Kendo\UI\EditorTool|array

Example - using \Kendo\UI\EditorTool

<?php
$editor = new \Kendo\UI\Editor('Editor');
$tool = new \Kendo\UI\EditorTool();
$columns = 1;
$tool->columns($columns);
$editor->addTool($tool);
?>

Example - using array

<?php
$editor = new \Kendo\UI\Editor('Editor');
$columns = 1;
$editor->addTool(array('columns' => $columns));
?>

Example - adding more than one EditorTool

<?php
$editor = new \Kendo\UI\Editor('Editor');
$first  = new \Kendo\UI\EditorTool();
$second = new \Kendo\UI\EditorTool();
$editor->addTool($first, $second);
?>

unsafeInline

When set to false, the decoration applied by the Formatting tool dropdown will be skipped and the values will appear as plain text options.

Returns

\Kendo\UI\Editor

Parameters

$value boolean

Example

<?php
$editor = new \Kendo\UI\Editor('Editor');
$editor->unsafeInline(true);
?>
In this article
Not finding the help you need?