forked from RobinDev/DataTablesPHP
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Helper.php
29 lines (27 loc) · 783 Bytes
/
Helper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
namespace rOpenDev\DataTablesPHP;
/**
* PHP DataTablesPHP Helper
*
* @author Original Author Robin <contact@robin-d.fr> http://www.robin-d.fr/
* @link http://www.robin-d.fr/DataTablesPHP/
* @link https://github.com/RobinDev/DataTablesPHP
* @since File available since Release 2014.12.02
*/
class Helper
{
/**
* html render function
*
* @param array $attributes
*
* @return string
*/
public static function mapAttributes($attributes)
{
return ' '.join(' ', array_map(
function ($sKey) use ($attributes) {
return is_bool($attributes[$sKey]) ? ($attributes[$sKey] ? $sKey : '') : $sKey.'="'.$attributes[$sKey].'"';
}, array_keys($attributes)
));
}