0">getAttribute('value'), $value))
151 {
152 $option->setAttribute('selected', 'selected');
153 }
154 }
155 else if ($value == $option->getAttribute('value'))
156 {
157 $option->setAttribute('selected', 'selected');
158 }
159 }
160 }
161 }
162
163 return $dom;
164 }
165
166 protected function hasValue($values, $name)
167 {
168 if (array_key_exists($name, $values))
169 {
170 return true;
171 }
172
173 return null !== sfToolkit::getArrayValueForPath($values, $name);
174 }
175
176 protected function getValue($values, $name)
177 {
178 if (array_key_exists($name, $values))
179 {
180 return $values[$name];
181 }
182
183 return sfToolkit::getArrayValueForPath($values, $name);
184 }
185
186 protected function escapeValue($value, $name)
187 {
188 if (function_exists('iconv') && strtolower(sfConfig::get('sf_charset')) != 'utf-8')
189 {
190 $new_value = iconv(sfConfig::get('sf_charset'), 'UTF-8', $value);
191 if (false !== $new_value)
192 {
193 $value = $new_value;
194 }
195 }
196
197 if (isset($this->converters[$name]))
198 {
199 foreach ($this->converters[$name] as $callable)
200 {
201 $value = call_user_func($callable, $value);
202 }
203 }
204
205 return $value;
206 }
207 }
208
首页
/ JavaScript