aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/forms/RadioInput.php
blob: 1945d87cbb868f9fd139bde12750ff9552247833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

namespace Studip\Forms;

class RadioInput extends Input
{
    public function render()
    {
        $options = $this->extractOptionsFromAttributes($this->attributes);
        $template = $GLOBALS['template_factory']->open('forms/radio_input');
        $template->title = $this->title;
        $template->name = $this->name;
        $template->value = $this->value;
        $template->id = md5(uniqid());
        $template->required = $this->required;
        $template->options = $options;
        $template->attributes = arrayToHtmlAttributes($this->attributes);
        $template->orientation = $this->attributes['orientation'];
        return $template->render();

    }
}