技术头条 - 一个快速在微博传播文章的方式     搜索本站
您现在的位置首页 --> JavaScript --> DOMComment 和 DOMXPath的应用sample

DOMComment 和 DOMXPath的应用sample

浏览:814次  出处信息
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[$nameas $callable)
200       {
201         $value = call_user_func($callable, $value);
202       }
203     }
204 
205     return $value;
206   }
207 }
208 

QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习
© 2009 - 2024 by blogread.cn 微博:@IT技术博客大学习

京ICP备15002552号-1