public static function appendMobileInputModeAttributesForFormWidget(sfWidget $widget, $mode = 'alphabet') { $modes = array('hiragana' => 1, 'hankakukana' => 2, 'alphabet' => 3, 'numeric' => 4); if (empty($modes[$mode])) { return false; } $widget->setAttribute('istyle', $modes[$mode]); $widget->setAttribute('mode', $mode); }