Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework] Obługa multiple input
Jav
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 7.05.2012

Ostrzeżenie: (0%)
-----


Mam taki oto formularz.

  1. class Admin_Form_Photo extends Zend_Form
  2. {
  3. public function init()
  4. {
  5. $this->setMethod('post');
  6.  
  7. $this->addElement(new Zend_Form_Element_File('photo', array(
  8. 'label' => 'Zdjęcie',
  9. 'multiple' => 'multiple',
  10. 'required' => true
  11. )));
  12.  
  13. $this->getElement('photo')->setAttrib('name', 'photos[]');
  14.  
  15. $this->addElement(new Zend_Form_Element_Submit('submit', array(
  16. 'label' => 'Wyślij'
  17. )));
  18. }
  19. }


Tym formularzem przesyłam kilka plików na raz. Czy ktoś mógłby mi wytłumaczyć w jaki sposób odebrać dane tych plików w formularzu też żeby były dostępne przez $form->getValues() ? Standardowe odbieranie w ten sposób:
  1. if($this->getRequest()->isPost()){
  2. $form = new Admin_Form_Photo();
  3. if($form->isValid($this->getRequest()->getPost())){
  4. $data = $form->getValues();
  5. }
  6. }

Zwraca mi pustą tablicę.

Ten post edytował Jav 9.05.2012, 12:26:12
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 10:02