/** * Returns a radio button tag. * * The radio button will be checked if the current value of <var>$method</var> is * equal to <var>$tagValue</var>. * Example : * <code>radio_button('post', 'title', $this->post, 'Hello World'); * <input id="post_title_hello_world" name="post[title]" type="radio" value="Hello World" /></code> */ function radio_button($objectName, $method, $object, $tagValue, $options = array()) { list($name, $value, $options) = default_options($objectName, $method, $object, $options); $options['id'] .= '_' . SInflection::wikify($tagValue); if ($value == $tagValue) { $checked = True; } else { $checked = False; } return radio_button_tag($name, $tagValue, $checked, $options); }
function testWikify() { $this->assertEqual('hello_world', SInflection::wikify('Hello World')); }