Пример #1
0
 private function _retrieveData()
 {
     if ($this->isFormSent()) {
         $this->data = array();
         $fields = $this->template->getFields();
         foreach ($fields as $field) {
             $name = str_replace($this->templateName . "_", "", $field->getName());
             $field->setValue($_POST[$field->getName()]);
             $this->data[$name] = $field->getValue();
         }
     }
     $this->template->setData($this->data);
     return $this->data;
 }
Пример #2
0
 private function _retrieveData()
 {
     if ($this->isFormSent()) {
         $this->data = array();
         $fields = $this->template->getFields();
         foreach ($fields as $field) {
             $key = str_replace(array(".", "[]"), array("_", ""), $field->getName());
             for ($i = 0; $i < count($_POST[$key]) - 1; $i++) {
                 $name = str_replace(array($this->templateName . ".", "[]"), array("", ""), $field->getName());
                 $field->setValue($_POST[$key][$i]);
                 $this->data[$i][$name] = $field->getValue();
             }
         }
     }
     foreach ($this->data as $data) {
         $this->template->setData($data);
     }
     return $this->data;
 }