00001 <?php
00002
00003 namespace Habari;
00004
00008 class FormControlRepeater extends FormContainer
00009 {
00013 public function _extend()
00014 {
00015 $this->set_settings(array(
00016 'ignore_name' => true,
00017 'process' => false,
00018 ));
00019 }
00020
00026 public function get(Theme $theme)
00027 {
00028 $this->vars['element'] = $this->get_setting('wrap_element', 'div');
00029
00030 $content = '';
00031
00032 foreach($this->value as $key => $data) {
00033
00034 $this->each(function(FormControl $control) use($key) {
00035 $control->add_input_array($key);
00036 });
00037
00038 $content .= $this->get_contents($theme);
00039
00040
00041 $this->each(function(FormControl $control) {
00042 $control->pop_input_array();
00043 });
00044 }
00045
00046 $this->vars['content'] = $content;
00047
00048 return FormControl::get($theme);
00049 }
00050 }
00051
00052 ?>