phpDocumentor form
[ class tree: form ] [ index: form ] [ all elements ]

Source for file Radio.php

Documentation is available at Radio.php

  1. <?
  2. /**
  3. * @package form
  4. * @filesource
  5. * @see HTML_FORM_COMPONENT_PATH.'/Radio.php'
  6. * @copyright (c) http://Finn-Rasmussen.com
  7. * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
  8. * @author http://Finn-Rasmussen.com
  9. * @version 1.9
  10. * @since 21-oct-2005
  11. */
  12.  
  13. /**
  14. * The required files
  15. */
  16. require_once(HTML_FORM_COMPONENT_PATH.'/Input.php');
  17.  
  18. /**
  19. * Generates an INPUT element for a form, which is a Radio control
  20. * <code>
  21. * <input type="radio" name="$name" value="$value" title="$title" tabindex=""
  22. * class="$class" checked="$checked" onclick="alert('Hello')" />
  23. * Usage:
  24. * $radio = new Radio($name,$value,$class,$checked,$onclick,$title,$tabindex);
  25. * print $radio->getHtml();
  26. * Or
  27. * Radio::display($name,$value,$class,$checked,$onclick,$title,$tabindex);
  28. * </code>
  29. * @package form
  30. */
  31.  
  32. class Radio extends Input {
  33. /**
  34. * Constructor
  35. * @param String $name The name
  36. * @param String $value The value, if any
  37. * @param String $class The class
  38. * @param String $checked The checked, if present
  39. * @param String $onclick On click event for javascript
  40. * @param String $title The tooltip
  41. * @param String $tabindex The tabindex
  42. */
  43. function Radio($name,$value='',$class='',$checked='',$onclick='',$title='',$tabindex='') {
  44. $aClass = $class!=''?$class:CSS_RADIO_CLASS;
  45. $this->Input('radio',$name,$value,$aClass,$checked,'','','',$onclick,$title,$tabindex);
  46. }
  47.  
  48. /**
  49. * Display html
  50. * <code>
  51. * Usage:
  52. * Radio::display($name,$value,$class,$checked,$onclick,$title,$tabindex);
  53. * </code>
  54. * @static
  55. * @param String $name The name
  56. * @param String $value The value, if any
  57. * @param String $class The class
  58. * @param String $checked The checked, if present
  59. * @param String $onclick On click event for javascript
  60. * @param String $title The tooltip
  61. * @param String $tabindex The tabindex
  62. */
  63. function display($name='',$value='',$class='',$checked='',$onclick='',$title='',$tabindex='') {
  64. $html = new Radio($name,$value,$class,$checked,$onclick,$title,$tabindex);
  65. $html->addHtml();
  66. }
  67. }
  68. ?>

Documentation generated on Thu, 22 Dec 2005 17:16:11 +0100 by phpDocumentor 1.3.0RC3