title | page_title | description | slug |
---|---|---|---|
Overview |
Overview |
How to configure and use the Loader PHP class in Kendo UI. |
overview_loader_uiforphp |
The Kendo UI Loader for PHP is a server-side wrapper for the Kendo UI Loader widget.
The Loader provides a set of default API configuration options that can be set during its initialization. Follow the steps below to configure the Kendo UI Loader for PHP:
Step 1 Make sure you followed all the steps in the [introductory article on Telerik UI for PHP]({% slug overview_uiforphp %})—include the autoloader, JavaScript, and CSS files.
Step 2 Create a Loader:
$loader = new \Kendo\UI\Loader('loader');
Step 3 Output the Loader by echoing the result of the render
method:
<?= $loader->render() ?>
The Loader component provides several predefined appearance options such as different types, sizes and theme colors.
The Loader allows you to set different animations by using the type
input property.
The available types
values are:
-
pulsing
(Default)—Applies pulsing animation on the Loader. -
infinite-spinner
—Applies infinite-spinner animation on the Loader. -
converging-spinner
—Applies converging-spinner animation on the Loader.<?php $loader = new \Kendo\UI\Loader('loader'); $loader->type('infinite-spinner'); echo $loader->render(); ?>
The Loader allows you to specify predefined theme colors.
The available themeColor
values are:
-
primary
(Default)—Applies coloring based on primary theme color. -
secondary
—Applies coloring based on secondary theme color. -
tertiary
— Applies coloring based on tertiary theme color. -
info
—Applies coloring based on info theme color. -
success
— Applies coloring based on success theme color. -
warning
— Applies coloring based on warning theme color. -
error
— Applies coloring based on error theme color. -
dark
— Applies coloring based on dark theme color. -
light
— Applies coloring based on light theme color. -
inverse
— Applies coloring based on inverted theme color.<?php $loaderInfo = new \Kendo\UI\Loader('loaderInfo'); $loaderInfo->themeColor('info'); echo $loaderInfo->render(); ?>
The Loader allows you to set different sizes.
The available size
values are:
-
small
-
medium
(Default) -
large
<?php $loaderLarge = new \Kendo\UI\Loader('loaderLarge'); $loaderLarge->themeColor('large'); echo $loaderLarge->render(); ?>
To reference to an existing Loader instance, use the jQuery.data()
method. Once a reference is established, use the API to control its behavior.
The following example demonstrates how to access an existing Loader instance.
<?php
$loader = new \Kendo\UI\Loader('loader');
$loader->themeColor('secondary');
echo $loader->render();
?>
<script>
$(function() {
// The constructor parameter is used as the 'id' HTML attribute of the Loader
var loader = $("#loader").data("kendoLoader");
});
</script>