View Dosyası (views/announcements/form.php):
[sourcecode language="php"]
<?php echo form_open($this->table.'/'.$action); ?>
<table id="box-table-a">
<tr>
<td>
<h5>Title</h5>
</td>
<td>
<?php echo form_error('title'); ?>
<input type="text" name="title" value="<?php echo set_value('title', $title); ?>" size="40" />
</td>
</tr>
<tr>
<td>
<h5>Body</h5>
</td>
<td>
<?php echo form_error('body'); ?>
<textarea name="body" rows="5" cols="50"><?php echo set_value('body', $body);?></textarea>
</td>
</tr>
<tr>
<td>
<h5>Date</h5>
</td>
<td>
<?php echo form_error('date'); ?>
<input type="text" name="date" value="<?php echo set_value('date', $date); ?>" size="40" />
</td>
</tr>
<tr>
<td>
<h5>Status</h5>
</td>
<td>
<?php echo form_error('status'); ?>
<input type="checkbox" name="status" value="1" <?php echo set_checkbox('status', 1, $status == 1 ? TRUE : FALSE); ?> />
</td>
</tr>
<tr>
<td>
<h5>Position</h5>
</td>
<td>
<?php echo form_error('position'); ?>
<select name="position">
<option value="left" <?php echo set_select('position', 'left', $position == 'left' ? TRUE : FALSE); ?> >Left</option>
<option value="right" <?php echo set_select('position', 'right', $position == 'right' ? TRUE : FALSE); ?> >Right</option>
<option value="top" <?php echo set_select('position', 'top', $position == 'top' ? TRUE : FALSE); ?> >Top</option>
</select>
</td>
</tr>
<tr>
<td>
<h5>Color</h5>
</td>
<td>
<?php echo form_error('color'); ?>
<input type="radio" name="color" value="red" <?php echo set_radio('color', 'red', $color == 'red' ? TRUE : FALSE); ?> >Red
<input type="radio" name="color" value="blue" <?php echo set_radio('color', 'blue', $color == 'blue' ? TRUE : FALSE); ?> >Blue
<input type="radio" name="color" value="green" <?php echo set_radio('color', 'green', $color == 'green' ? TRUE : FALSE); ?> >Green
</td>
</tr>
<tr>
<td>
<h5>Password</h5>
</td>
<td>
<?php echo form_error('password'); ?>
<input type="password" name="password" value="" size="40" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="OK"/>
</td>
</tr>
</table>
</form>
[/sourcecode]
Hiç yorum yok:
Yorum Gönder