Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [ZendFramework] Usunięcie elementu z formularza
CzarnyGsm
post 18.07.2012, 12:27:00
Post #1





Grupa: Zarejestrowani
Postów: 84
Pomógł: 2
Dołączył: 16.04.2007

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


Witam,

W jaki sposób mogę usunąć z formualrza dla poszczególnego inputa atrybut 'id'?
Mam generowany:
  1. <input type="submit" name="signin"[b] id="signin"[/b] value="Sign in"></p>

A chciałbym
  1. <input type="submit" name="signin" value="Sign in"></p>

W jaki to sposób mogę zrobić?

Mój kod wygląda tak:
  1. ...
  2. $submit = new Zend_Form_Element_Submit('signin');
  3. $submit->setLabel($translator->translate("Sign in"))
  4. ->removeDecorator('label');
  5. ...
  6.  
  7. $this->clearDecorators();
  8. $this->addDecorator('FormElements')
  9. ->addDecorator('HtmlTag')
  10. ->addDecorator('Form', array('class' => 'styletol'));
  11.  
  12. $login->setDecorators(array(
  13. array('ViewHelper'),
  14. array('Description'),
  15. array('HtmlTag'),
  16. ));
  17.  
  18. $this->setElementDecorators(array(
  19. array('ViewHelper'),
  20. array('HtmlTag', array('tag' => 'p'))
  21. ));


Z góry dziękuję za pomoc.

Pozdrawiam
Go to the top of the page
+Quote Post
darko
post 18.07.2012, 14:45:34
Post #2





Grupa: Zarejestrowani
Postów: 2 885
Pomógł: 463
Dołączył: 3.10.2009
Skąd: Wrocław

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


Spróbuj:
  1. $submit = new Zend_Form_Element_Submit('signin');
  2. $submit->setLabel($translator->translate("Sign in"))
  3. ->removeDecorator('label')
  4. ->setOptions(array('id' => ''));



--------------------
Nie pomagam na pw, tylko forum.
Go to the top of the page
+Quote Post
Necsord
post 18.07.2012, 15:36:05
Post #3





Grupa: Zarejestrowani
Postów: 189
Pomógł: 60
Dołączył: 5.10.2010
Skąd: Bydgoszcz

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


Alternatywnie:
  1. $submit = new Zend_Form_Element_Submit('signin');
  2. $submit->setAttrib('id', '')
  3. ->setLabel($translator->translate("Sign in"))
  4. ->removeDecorator('label');


Ten post edytował Necsord 18.07.2012, 15:36:35
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: 24.04.2024 - 21:49