phplibrary/src/Form/SelectMany.php
Фёдор Подлеснов 7b3190f96e Вынес еще классы
2018-02-01 14:43:17 +03:00

14 lines
No EOL
365 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
class Form_SelectMany extends Form_Select
{
function setValue($value)
{
// Установить selected у options
if (!is_array($value)) { $value = array($value); }
$this->value = $value;
foreach ($this->options as &$option) {
$option['selected'] = (in_array($option['value'], $value));
}
}
}