public function checkboxGroup($name, $options, $selected = null, $htmlOptions = [], $template = '<input><label>', $separator = '<br />')
    {
        if (is_null($selected)) {
            $selected = $this->getArrayValue($_POST, $name);
            if (is_null($selected)) {
                $selected = $this->getArrayValue($_GET, $name);
            }
        }
        $r = array();
        foreach ($options as $value => $label) {
            $r[] = $this->checkbox($name . '[]', $label, $value, is_array($selected) ? in_array($value, $selected) : $selected == $value, $htmlOptions, $template);
        }
        return implode($separator, $r);
    }