Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [ZendFramework] Dekoratory - zmiana globalna, Zend Form
tomsol
post 18.03.2012, 12:27:37
Post #1





Grupa: Zarejestrowani
Postów: 36
Pomógł: 1
Dołączył: 15.01.2012

Ostrzeżenie: (10%)
X----


witajcie,
w jaki sposób utworzyć własne dekoratory from

mam np:
  1. public function init()
  2. {
  3. $username = $this->createElement('text', 'username');
  4. $username ->setLabel('Login:')
  5. ->setRequired(true);
  6.  
  7. $password = $this->createElement('password', 'password');
  8. $password ->setLabel('Hasło:')
  9. ->setRequired(true);
  10.  
  11. $password2 = $this->createElement('password', 'password2');
  12. $password2 ->setLabel('Potwierdź hasło:')
  13. ->setRequired(true);
  14.  
  15. $email = $this->createElement('text', 'mail');
  16. $email ->setLabel('Mail kontaktowy:')
  17. ->setRequired(true);
  18.  
  19. $name = $this->createElement('text', 'name');
  20. $name ->setLabel('Imię:')
  21. ->setRequired(true);
  22. $submit = $this->createElement('submit', 'signin');
  23. $submit ->setLabel('Rejestruj')
  24. ->setIgnore(true);
  25.  
  26.  
  27.  
  28. $this->addElements(array(
  29. $username,
  30. $password,
  31. $password2,
  32. $email,
  33. $name,
  34. $submit
  35. ));
  36. }


Chciałbym dodać własne dekoratory np: poprzez:
  1. $this->clearDecorators();
  2. $this->setDecorators(array( coś tam - tylko nie wiem jak to tu ustawić ;) ));


proszę o pomoc.
Go to the top of the page
+Quote Post
IceManSpy
post 18.03.2012, 13:17:38
Post #2





Grupa: Zarejestrowani
Postów: 1 006
Pomógł: 111
Dołączył: 23.07.2010
Skąd: Kraków

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


http://blog.wilgucki.pl/2009/11/dekorujemy...-framework.html
http://blog.wilgucki.pl/2010/08/dodawanie-...elementami.html


--------------------
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 03:29