\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

Deprecated! Use badge.options.shape instead.For compatibility badge.options.appearance maps to badge.options.shape.

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

badgeStyle

Defines the style of the badge

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

color

Defines the color of the badge

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

cutoutBorder

Specifies wether or not to render additional "cutout" border around the badge.

Returns

\Kendo\UI\Badge

Parameters

$value boolean

Example

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

icon

Defines the name for an existing icon in a Kendo UI theme or SVG content. The icon is rendered inside the badge by a span.k-icon or span.k-svg-icon element.See web font icons help article for more details on Kendo UI icons.

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

look

Deprecated! Use badge.options.badgeStyle instead.For compatibility badge.options.look maps to badge.options.badgeStyle.

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

max

If text is a number, it will cap that number.

Returns

\Kendo\UI\Badge

Parameters

$value float

Example

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

overlay

Deprecated! Use position instead.There is no built in mapping between overlay and position: overlay: false can be achieved by setting position: "inline" or overlay: true can be achieved by setting position: "top end", or not setting it at all.. For compatibility overlay is kept, even though it has no effect on the badge.

Returns

\Kendo\UI\Badge

Parameters

$value boolean

Example

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

placement

Defines the badge placement

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

position

Defines the position of the badge

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

shape

Defines the shape of the badge

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

size

Defines the size of the badge

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

<?php
$badge = new \Kendo\UI\Badge('Badge');
$badge->size('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() { }'));
?>

text

The text of the badge. Valid input includes string, number or object with toString method. Default is empty string.

Returns

\Kendo\UI\Badge

Parameters

$value string|float

Example - using string

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

Example - using float

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

type

Deprecated! Use badge.options.color instead.For compatibility badge.options.type maps to badge.options.color.

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

value

Deprecated! Use badge.options.text instead.For compatibility badge.options.value maps to badge.options.text.

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?