Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][Zend] problem z formularzami
sweter
post 30.05.2010, 16:15:24
Post #1





Grupa: Zarejestrowani
Postów: 623
Pomógł: 11
Dołączył: 1.01.2009
Skąd: Wrocław

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


Witam,
może mi ktoś wyjaśnić, w jaki sposób wprowadzić link w wartość "action" formularza?
U mnie formularz wygląda tak:
  1. class Login extends Zend_Form{
  2. public function init(){
  3. $login = new Zend_Form_Element_Text('login');
  4. $haslo = new Zend_Form_Element_Password('haslo');
  5. $submit = new Zend_Form_Element_Submit('submit');
  6.  
  7. $this->addElement($login);
  8. $this->addElement($haslo);
  9. $this->addElement($submit);
  10.  
  11. $login ->setLabel('Login:') // ertykieta
  12. ->setRequired(true); // pole jest wymagane
  13. $haslo ->setLabel('Hasło:') // ertykieta
  14. ->setRequired(true); // pole jest wymagane
  15. $submit ->setLabel('Zaloguj się');
  16.  
  17.  
  18. $this->clearDecorators(); // czyścimy wygląd
  19. $this ->addDecorator('FormElements')
  20. ->addDecorator('HtmlTag', array('tag' => 'div'))
  21. ->addDecorator('Form');
  22. $this ->setElementDecorators(array(
  23. array('ViewHelper'),
  24. array('Errors'),
  25. array('Label'),
  26. array('Description'),
  27. array('HtmlTag', array('class'=>'as'))
  28. ));
  29.  
  30. $submit ->setDecorators(array(
  31. array('ViewHelper'),
  32. array('HtmlTag', array('tag' => 'div', 'class' => 'submit-group'))
  33. ));
  34. }
  35. }

Z góry dzięki za pomoc smile.gif


--------------------
Go to the top of the page
+Quote Post
melkorm
post 30.05.2010, 18:23:36
Post #2





Grupa: Zarejestrowani
Postów: 1 366
Pomógł: 261
Dołączył: 23.09.2008
Skąd: Bydgoszcz

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


2 box z kodem 1 linijka

P.S. U Ciebie $form to $this.

Ten post edytował melkorm 30.05.2010, 18:24:40


--------------------
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: 16.07.2025 - 00:54