Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZF] Zend form w osobnym bloku (sidebar)?
macpain1982
post
Post #1





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 8.02.2012

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


Witam,
Mozecie mi wytlumaczyc jak mozna wyswietlic formularz np. logowania lub czego kolwiek w np. prawej kolumnie layoutu zachowujac walidajcje i wszystkie inne funkcje zwiazane z Zend Form.

Pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
macpain1982
post
Post #2





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 8.02.2012

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


Póki co mam podstawową walidację np. czy pola nie są puste lub czy emial jest poprawny:
  1. $this->setMethod('post');
  2. $this->setAction('/auth/');
  3.  
  4. // Add an email element
  5. $this->addElement('text', 'email', array(
  6. 'label' => 'Email:',
  7. 'required' => true,
  8. 'filters' => array('StringTrim'),
  9. 'validators' => array(
  10. 'EmailAddress',
  11. )
  12. ));
  13.  
  14. // Add a login element
  15. $this->addElement('password', 'password', array(
  16. 'label' => 'Password:',
  17. 'required' => true,
  18. 'filters' => array('StringTrim')
  19. ));
  20.  
  21. // And finally add some CSRF protection
  22. $this->addElement('hash', 'csrf', array(
  23. 'ignore' => true,
  24. ));
  25.  
  26. // Add the submit button
  27. $this->addElement('submit', 'submit', array(
  28. 'ignore' => true,
  29. 'label' => 'Login',
  30. ));

Ogólnie walidacja działa tylko w przypdaku gdy jestem w faktycznym widoku formularza. Dodając go do layoutu już nie (IMG:style_emoticons/default/sad.gif)

Ten post edytował macpain1982 16.02.2012, 23:12:17
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 6.10.2025 - 14:17