values = []; foreach ($values as $value) { if (isset($this->options[$value])) { $this->values[] = $value; } } return $this->values; } /** * @return string */ protected function renderOptions() { $html = ''; foreach ($this->options as $key => $val) { $selected = in_array((string)$key, $this->values) ? ' selected="selected"' : ''; $attrs = ''; if (!empty($val['attrs']) && is_array($val['attrs'])) { $attrs = buildAttributes($val['attrs']); } $html .= ''; $html .= hsc($val['label']); $html .= ''; } return $html; } }