\Kendo\UI\Badge

A PHP wrapper for Kendo UI Badge.

Inherits from \Kendo\UI\Widget.

Usage

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

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

// Configure it
$badge->appearance('value')

// Output it

echo $badge->render();
?>

Methods

appearance

Specifies the shape of the badge - rectangle or pill.

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

<?php
$badge = new \Kendo\UI\Badge('Badge');
$badge->appearance('value');
?>

look

Specifies the look of the badge - flat or outline.

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

<?php
$badge = new \Kendo\UI\Badge('Badge');
$badge->look('value');
?>

template

The template which renders the content of the badge

Returns

\Kendo\UI\Badge

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

<?php
$badge = new \Kendo\UI\Badge('Badge');
$badge->template('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$badge = new \Kendo\UI\Badge('Badge');
$badge->template(new \Kendo\JavaScriptFunction('function() { }'));
?>

type

Specifies the type of the badge - primary, secondary, info, success, warning and error.

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

<?php
$badge = new \Kendo\UI\Badge('Badge');
$badge->type('value');
?>

value

The value of the badge

Returns

\Kendo\UI\Badge

Parameters

$value string|float

Example - using string

<?php
$badge = new \Kendo\UI\Badge('Badge');
$badge->value('value');
?>

Example - using float

<?php
$badge = new \Kendo\UI\Badge('Badge');
$badge->value(1);
?>

visible

If set to false the badge will not be displayed.

Returns

\Kendo\UI\Badge

Parameters

$value boolean

Example

<?php
$badge = new \Kendo\UI\Badge('Badge');
$badge->visible(true);
?>
In this article
Not finding the help you need?