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

namespace Studip\Forms;

class SelectInput extends Input
{
    public function render()
    {
        $options = $this->extractOptionsFromAttributes($this->attributes);

        $template = $GLOBALS['template_factory']->open('forms/select_input');
        $template->title = $this->title;
        $template->name = $this->name;
        $template->value = $this->getValue();
        $template->id = md5(uniqid());
        $template->required = $this->required;
        $template->attributes = arrayToHtmlAttributes($this->attributes);
        $template->options = $options;
        return $template->render();
    }
}