Changeset 1543
- Timestamp:
- 12/15/07 17:07:27 (7 months ago)
- Files:
-
- trunk/modules/forge/libraries/Forge.php (modified) (2 diffs)
- trunk/modules/forge/libraries/Form_Group.php (added)
- trunk/modules/forge/views/forge_template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/modules/forge/libraries/Forge.php
r1542 r1543 12 12 ); 13 13 14 p rotected$inputs = array();15 p rotected$hidden = array();14 public $inputs = array(); 15 public $hidden = array(); 16 16 17 17 public function __construct($action = '', $title = '', $method = NULL, $class = NULL) … … 53 53 } 54 54 55 if ( ! ($input instanceof Form_Input) )55 if ( ! ($input instanceof Form_Input) AND ! ($input instanceof Forge)) 56 56 throw new Kohana_Exception('forge.invalid_input', get_class($input)); 57 57 trunk/modules/forge/views/forge_template.php
r1522 r1543 2 2 <table class="<?php echo $class ?>"> 3 3 <caption><?php echo $title ?></caption> 4 <?php foreach($inputs as $input): ?> 4 <?php 5 foreach($inputs as $input): 6 7 $sub_inputs = array(); 8 if ($input->type == 'group') 9 { 10 $sub_inputs = $input->inputs; 11 12 ?> 13 <tr> 14 <th colspan="2"><?php echo $input->label() ?></th> 15 </tr> 16 <?php 17 18 } 19 else 20 { 21 $sub_inputs = array($input); 22 } 23 24 foreach($sub_inputs as $input): 25 26 ?> 5 27 <tr> 6 28 <th><?php echo $input->label() ?></th> 7 29 <td><?php echo $input->html() ?></td> 8 30 </tr> 9 <?php endforeach; ?> 31 <?php 32 33 endforeach; 34 35 endforeach; 36 ?> 10 37 </table> 11 38 <?php echo $close ?>
