Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo $form->create('Post', array(
- 'url' => '/posts/index',
- 'type' => 'file',
- ));
- echo $form->input('text', array(
- 'type' =>'text',
- 'value' => 'default value',
- ));
- echo $form->input('textarea', array(
- 'type' =>'textarea',
- 'value' => 'default value',
- ));
- $options = array(
- '1' => 'Option 1',
- '2' => 'Option 2',
- '3' => 'Option 3',
- );
- echo $form->input('select', array(
- 'type' =>'select',
- 'options' => $options,
- 'selected' => 2,
- 'empty' => 'Please Select'
- ));
- echo $form->input('multiple_select', array(
- 'type' =>'select',
- 'options' => $options,
- 'selected' => 2,
- 'empty' => 'Please Select Multiple',
- 'multiple' => true
- ));
- echo $form->input('checkbox', array(
- 'type' =>'select',
- 'multiple'=> 'checkbox',
- 'options' => $options,
- 'selected' => 2,
- ));
- echo $form->input('radio', array(
- 'type' =>'radio',
- 'options' => $options,
- 'legend' => 'Radio',
- 'default' => '2'
- ));
- ?>
- <fieldset>
- <legend>CheckBoxes</legend>
- <?php
- echo $form->input('checkbox2', array(
- 'type' => 'checkbox',
- 'value' =>'1',
- 'checked' => 'checked',
- 'label' => 'Choice 1'
- ));
- echo $form->input('checkbox2', array(
- 'type' => 'checkbox',
- 'value' =>'2',
- 'label' => 'Choice 2'
- ));
- ?>
- </fieldset>
- <?php
- echo $form->input('file', array(
- 'type' => 'file',
- 'label' => 'Browse File'
- ));
- echo $form->input('date', array(
- 'type' => 'date',
- 'label' => 'Date',
- 'minYear' => 1900,
- 'maxYear' => 2010,
- # default order m/d/y
- 'selected' => array(
- 'month' => '03',
- 'day' => '09',
- 'year' => '1977'
- ),
- ));
- echo $form->input('time', array(
- 'type' => 'time',
- 'label' => 'Time',
- 'selected' => array(
- 'hour' => '12',
- 'min' => '15',
- 'meridian' => 'pm'
- ),
- ));
- echo $form->input('datetime', array(
- 'type' => 'datetime',
- 'label' => 'Date Time',
- 'minYear' => 1900,
- 'maxYear' => 2010,
- # default order m/d/y
- 'selected' => array(
- 'month' => '03',
- 'day' => '09',
- 'year' => '1977',
- 'hour' => '13',
- 'min' => '10',
- 'meridian' => 'am'
- ),
- ));
- echo $form->submit('Submit');
- echo $form->end();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement