\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->align('value')

// Output it

echo $badge->render();
?>

Methods

align

Defines the alignment of the badge

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

fill

Defines how theme colors are applied to a badge

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

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

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

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

themeColor

Defines the color of the badge

Returns

\Kendo\UI\Badge

Parameters

$value string

Example

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

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?