\Kendo\UI\TextArea

A PHP wrapper for Kendo UI TextArea.

Inherits from \Kendo\UI\Widget.

Usage

To use TextArea 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 TextArea

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

// Configure it
$textArea->cols(1)

// Output it

echo $textArea->render();
?>

Methods

change

Fired when the value of the widget is changed by the user.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the change event documentation.

Returns

\Kendo\UI\TextArea

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

cols

The visible width of the text control, in average character widths.

Returns

\Kendo\UI\TextArea

Parameters

$value float

Example

<?php
$textArea = new \Kendo\UI\TextArea('TextArea');
$textArea->cols(1);
?>

enable

If set to false, the widget will be disabled and will not allow user input. The widget is enabled by default and allows user input.

Returns

\Kendo\UI\TextArea

Parameters

$value boolean

Example

<?php
$textArea = new \Kendo\UI\TextArea('TextArea');
$textArea->enable(true);
?>

label

Adds a label before the textarea. If the textarea has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.

Returns

\Kendo\UI\TextArea

Parameters

$value string|\Kendo\JavaScriptFunction|\Kendo\UI\TextAreaLabel|array

Example - using string

<?php
$textArea = new \Kendo\UI\TextArea('TextArea');
$textArea->label('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$textArea = new \Kendo\UI\TextArea('TextArea');
$textArea->label(new \Kendo\JavaScriptFunction('function() { }'));
?>

Example - using \Kendo\UI\TextAreaLabel

<?php
$textArea = new \Kendo\UI\TextArea('TextArea');
$label = new \Kendo\UI\TextAreaLabel();
$content = 'value';
$label->content($content);
$textArea->label($label);
?>

Example - using array

<?php
$textArea = new \Kendo\UI\TextArea('TextArea');
$content = 'value';
$textArea->label(array('content' => $content));
?>

maxLength

The maximum number of characters that the user can enter.

Returns

\Kendo\UI\TextArea

Parameters

$value float

Example

<?php
$textArea = new \Kendo\UI\TextArea('TextArea');
$textArea->maxLength(1);
?>

placeholder

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

Returns

\Kendo\UI\TextArea

Parameters

$value string

Example

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

readonly

If set to true, the widget will be readonly and will not allow user input. The widget is not readonly by default and allows user input.

Returns

\Kendo\UI\TextArea

Parameters

$value boolean

Example

<?php
$textArea = new \Kendo\UI\TextArea('TextArea');
$textArea->readonly(true);
?>

resizable

Defines if (and how) the widget is resizable by the user.Can also be set to the following string values: "none" - default value. The user cannot resize the widget.; "both" - the user can resize both the height and width of the widget.; "horizontal" - the user can resize the width of the widget. or "vertical" - the user can resize the height of the widget..

Returns

\Kendo\UI\TextArea

Parameters

$value string

Example

<?php
$textArea = new \Kendo\UI\TextArea('TextArea');
$textArea->resizable('value');
?>

rows

The number of visible text lines for the control.

Returns

\Kendo\UI\TextArea

Parameters

$value float

Example

<?php
$textArea = new \Kendo\UI\TextArea('TextArea');
$textArea->rows(1);
?>

value

The value of the widget.

Returns

\Kendo\UI\TextArea

Parameters

$value string

Example

<?php
$textArea = new \Kendo\UI\TextArea('TextArea');
$textArea->value('value');
?>
In this article
Not finding the help you need?