Advertisement
Guest User

Azril Nazli

a guest
Jul 13th, 2010
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.07 KB | None | 0 0
  1. <?php
  2. echo $form->create('Post', array(
  3. 'url' => '/posts/index',
  4. 'type' => 'file',      
  5. ));
  6.  
  7. echo $form->input('text', array(
  8. 'type' =>'text',
  9. 'value' => 'default value',
  10. ));
  11. echo $form->input('textarea', array(
  12. 'type' =>'textarea',
  13. 'value' => 'default value',
  14. ));
  15.  
  16. $options = array(
  17. '1' => 'Option 1', 
  18. '2' => 'Option 2',
  19. '3' => 'Option 3',
  20. );
  21. echo $form->input('select', array(
  22. 'type' =>'select',
  23. 'options' => $options,
  24. 'selected' => 2,
  25. 'empty' => 'Please Select'
  26. ));
  27.  
  28.  
  29. echo $form->input('multiple_select', array(
  30. 'type' =>'select',
  31. 'options' => $options,
  32. 'selected' => 2,
  33. 'empty' => 'Please Select Multiple',
  34. 'multiple' => true
  35. ));
  36.  
  37.  
  38. echo $form->input('checkbox', array(
  39. 'type' =>'select',
  40. 'multiple'=> 'checkbox',                               
  41. 'options' => $options,
  42. 'selected' => 2,
  43. ));
  44.  
  45. echo $form->input('radio', array(
  46. 'type' =>'radio',
  47. 'options' => $options,
  48. 'legend' => 'Radio',
  49. 'default' => '2'
  50.  
  51. ));
  52. ?>
  53.  
  54. <fieldset>                         
  55. <legend>CheckBoxes</legend>                            
  56. <?php
  57. echo $form->input('checkbox2', array(
  58. 'type'  => 'checkbox',
  59. 'value' =>'1',
  60. 'checked' => 'checked',
  61. 'label' => 'Choice 1'
  62. ));
  63.  
  64.  
  65. echo $form->input('checkbox2', array(
  66. 'type'  => 'checkbox',
  67. 'value' =>'2',
  68. 'label' => 'Choice 2'
  69. ));
  70. ?>
  71. </fieldset>
  72.  
  73. <?php
  74. echo $form->input('file', array(
  75. 'type'  => 'file',
  76.  
  77. 'label' => 'Browse File'
  78. ));
  79.  
  80. echo $form->input('date', array(
  81. 'type'  => 'date',
  82. 'label' => 'Date',
  83. 'minYear' => 1900,
  84. 'maxYear' => 2010,
  85. # default order m/d/y
  86. 'selected' => array(
  87. 'month' => '03',
  88. 'day' =>  '09',
  89. 'year' => '1977'
  90.     ),
  91.  
  92. ));
  93.  
  94. echo $form->input('time', array(
  95. 'type'  => 'time',
  96. 'label' => 'Time',
  97. 'selected' => array(
  98. 'hour' =>  '12',
  99. 'min' => '15',
  100. 'meridian' => 'pm'
  101.     ),
  102. ));                            
  103.  
  104.  
  105. echo $form->input('datetime', array(
  106. 'type'  => 'datetime',
  107. 'label' => 'Date Time',
  108. 'minYear' => 1900,
  109. 'maxYear' => 2010,
  110. # default order m/d/y
  111. 'selected' => array(
  112. 'month' => '03',
  113. 'day' =>  '09',
  114. 'year' => '1977',                              
  115. 'hour' =>  '13',
  116. 'min' => '10',
  117. 'meridian' => 'am'
  118. ),
  119. ));
  120. echo $form->submit('Submit');
  121. echo $form->end();                             
  122. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement