\Kendo\UI\ImageEditor
A PHP wrapper for Kendo UI ImageEditor.
Inherits from \Kendo\UI\Widget.
Usage
To use ImageEditor 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 ImageEditor
<?php
// Create a new instance of ImageEditor and specify its id
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
// Configure it
$imageEditor->height(1)
// Output it
echo $imageEditor->render();
?>
Methods
error
Fired when an error happened with the image loading. For additional information check the error event documentation.
Returns
\Kendo\UI\ImageEditor
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->error('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onError(e) {
// handle the error event.
}
</script>
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->error('onError');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->error(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
execute
Fired when a command is executed. For additional information check the execute event documentation.
Returns
\Kendo\UI\ImageEditor
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->execute('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onExecute(e) {
// handle the execute event.
}
</script>
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->execute('onExecute');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->execute(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
height
Configures the width of the ImageEditor.
Returns
\Kendo\UI\ImageEditor
Parameters
$value float|string
Example - using float
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->height(1);
?>
Example - using string
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->height('value');
?>
imageLabel
Sets the label used for the
Returns
\Kendo\UI\ImageEditor
Parameters
$value string
Example
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->imageLabel('value');
?>
imageLoaded
Fired when image is loaded. Can prevent the image rendering by calling the preventDefault() method. For additional information check the imageLoaded event documentation.
Returns
\Kendo\UI\ImageEditor
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->imageLoaded('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onImageLoaded(e) {
// handle the imageLoaded event.
}
</script>
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->imageLoaded('onImageLoaded');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->imageLoaded(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
imageRendered
Fired when canvas is rendered with the image. This event is triggered by commands and when drawCanvas method is called. For additional information check the imageRendered event documentation.
Returns
\Kendo\UI\ImageEditor
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->imageRendered('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onImageRendered(e) {
// handle the imageRendered event.
}
</script>
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->imageRendered('onImageRendered');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->imageRendered(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
imageUrl
Sets the url (or base64 string) for the image to open.
Returns
\Kendo\UI\ImageEditor
Parameters
$value string
Example
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->imageUrl('value');
?>
messages
Defines the text of the localizable UI parts of the FileManager.
Returns
\Kendo\UI\ImageEditor
Parameters
$value \Kendo\UI\ImageEditorMessages|array
Example - using \Kendo\UI\ImageEditorMessages
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$messages = new \Kendo\UI\ImageEditorMessages();
$toolbar = new \Kendo\UI\ImageEditorMessagesToolbar();
$messages->toolbar($toolbar);
$imageEditor->messages($messages);
?>
Example - using array
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$toolbar = new \Kendo\UI\ImageEditorMessagesToolbar();
$imageEditor->messages(array('toolbar' => $toolbar));
?>
saveAs
Sets the saveAs options for the save command. Utilizes the kendo.saveAs method.
Returns
\Kendo\UI\ImageEditor
Parameters
$value \Kendo\UI\ImageEditorSaveAs|array
Example - using \Kendo\UI\ImageEditorSaveAs
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$saveAs = new \Kendo\UI\ImageEditorSaveAs();
$fileName = 'value';
$saveAs->fileName($fileName);
$imageEditor->saveAs($saveAs);
?>
Example - using array
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$fileName = 'value';
$imageEditor->saveAs(array('fileName' => $fileName));
?>
toolbar
Configures the Toolbar of the ImageEditor
Returns
\Kendo\UI\ImageEditor
Parameters
$value boolean|\Kendo\UI\ImageEditorToolbar|array
Example - using boolean
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->toolbar(true);
?>
Example - using \Kendo\UI\ImageEditorToolbar
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$toolbar = new \Kendo\UI\ImageEditorToolbar();
$click = new \Kendo\JavaScriptFunction('function() { }');
$toolbar->click($click);
$imageEditor->toolbar($toolbar);
?>
Example - using array
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$click = new \Kendo\JavaScriptFunction('function() { }');
$imageEditor->toolbar(array('click' => $click));
?>
width
Configures the width of the ImageEditor.
Returns
\Kendo\UI\ImageEditor
Parameters
$value float|string
Example - using float
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->width(1);
?>
Example - using string
<?php
$imageEditor = new \Kendo\UI\ImageEditor('ImageEditor');
$imageEditor->width('value');
?>