title | page_title | description | slug | position |
---|---|---|---|---|
Overview |
Overview | Window PHP Class |
Get started with the Window PHP class in Kendo UI. |
overview_window_uiforphp |
1 |
The Kendo UI Window for PHP is a server-side wrapper for the Kendo UI Window widget.
Below are listed the steps for you to follow when configuring the Kendo UI Window for PHP.
Step 1 Make sure you followed all the steps from the [introductory article on Telerik UI for PHP]({% slug overview_uiforphp %})—include the autoloader, JavaScript, and CSS files.
Step 2 Create a Window.
<?php
$window = new \Kendo\UI\Window('window');
$window->title("About Alvar Aalto")
->draggable(true)
->width(600)
->resizable(true);
?>
Step 3 Place the content between the startContent
and endContent
method calls.
<?php
$window = new \Kendo\UI\Window('window');
$window->title("About Alvar Aalto")
->draggable(true)
->width(600)
->resizable(true)
->startContent();
?>
Static content of the Window
<?php
$window->endContent();
?>
Step 4 Output the Window by echoing the result of the render
method.
<?php
echo $window->render();
?>
You are able to load views asynchronously through the content
method, demonstrated in the example below.
<?php
$window = new \Kendo\UI\Window('window');
$window->content(array(
"url" => "ajaxContent.html"
));
echo $window->render();
?>
You can subscribe to all Window events.
The example below demonstrates how to subscribe for events by specifying a JavaScript function name.
<?php
$window = new \Kendo\UI\Window('window');
// The 'window_open' JavaScript function will handle the 'open' event of the window
$window->open('window_open');
echo $window->render();
?>
<script>
function window_open() {
// Handle the open event
}
</script>
The example below demonstrates how to subscribe to events by providing inline JavaScript code.
<?php
$window = new \Kendo\UI\Window('window');
// Provide inline JavaScript code that will handle the 'open' event of the window
$window->open('function() { /* Handle the open event */ }');
echo $window->render();
?>
You are able to reference an existing Window instance via the jQuery.data()
. Once a reference is established, use the Window API to control its behavior.
<?php
$window = new \Kendo\UI\Window('window');
echo $window->render();
?>
<script>
$(function() {
// The constructor parameter is used as the 'id' HTML attribute of the window
var window = $("#window").data("kendoWindow");
});
</script>
- [Overview of the Kendo UI Window Widget]({% slug overview_kendoui_window_widget %})
- Telerik UI for PHP API Reference Folder
- [Telerik UI for PHP Classes Folder]({% slug overview_autocomplete_uiforphp %})