Completed
Push — master ( 633f87...d85777 )
by Cheren
03:16
created

CheckboxWidget   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 8 1
1
<?php
2
/**
3
 * CakeCMS Core
4
 *
5
 * This file is part of the of the simple cms based on CakePHP 3.
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @package     Core
10
 * @license     MIT
11
 * @copyright   MIT License http://www.opensource.org/licenses/mit-license.php
12
 * @link        https://github.com/CakeCMS/Core".
13
 * @author      Sergey Kalistratov <[email protected]>
14
 */
15
16
namespace Core\View\Widget\MaterializeCss;
17
18
use Cake\View\Form\ContextInterface;
19
use Cake\View\Widget\CheckboxWidget as CakeCheckboxWidget;
20
21
/**
22
 * Class CheckboxWidget
23
 *
24
 * @package Core\View\Widget\MaterializeCss
25
 */
26
class CheckboxWidget extends CakeCheckboxWidget
27
{
28
29
    /**
30
     * Render a checkbox element.
31
     *
32
     * @param   array $data The data to create a checkbox with.
33
     * @param   \Cake\View\Form\ContextInterface $context The current form context.
34
     * @return  string Generated HTML string.
35
     */
36
    public function render(array $data, ContextInterface $context)
37
    {
38
        $data += ['class' => ''];
39
        $data['class'] .= ' filled-in ';
40
        $data['class'] = trim($data['class']);
41
42
        return parent::render($data, $context);
43
    }
44
}
45