Loader PHP Class Overview

The Kendo UI Loader for PHP is a server-side wrapper for the Kendo UI Loader widget.

Telerik UI for PHP DevCraft image

The Loader is part of Telerik UI for PHP, a professional grade UI library with 90+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.

Getting Started

Configuration

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—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() ?>

Appearance

The Loader component provides several predefined appearance options such as different types, sizes and theme colors.

Type

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();
    ?>
    

Theme Color

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();
    ?>
    

Size

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();
    ?>
    

Reference

Client-Side Instances

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>

See Also

In this article
Not finding the help you need? Improve this article