Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [ZendFramework] Zend_Form_Element_Checkbox i opis
ximus
post
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 1.10.2009

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


Witam serdecznie,

mam poniższy kod:

  1. $reg = new Zend_Form_Element_Checkbox('reg');
  2. $reg->setLabel('Regulamin')->setRequired();


Wszystko jest ok - element generuje się poprawnie. Jak jednak dodać opis do danego elementu? Jest sytuacja żywcem wzięta z rejestracji - akceptacja regulaminu. Jest kolumna opis - zawiera ona "Regulamin" w drugiej natomiast ma być checkbox i tuż obok niego tekst: "Akceptuję regulamin". Jak rozwiązać tego typu problem?
Go to the top of the page
+Quote Post
batman
post
Post #2





Grupa: Moderatorzy
Postów: 2 921
Pomógł: 269
Dołączył: 11.08.2005
Skąd: 127.0.0.1




Chodzi Ci o:
  1. $reg->setDescription('Twój opis');

?


--------------------
I would love to change the world, but they won't give me the source code.
My software never has bugs. It just develops random features.
Go to the top of the page
+Quote Post
Sajrox
post
Post #3





Grupa: Zarejestrowani
Postów: 254
Pomógł: 7
Dołączył: 9.10.2007
Skąd: Poznań

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


Tak jak pisze @batman tylko do tego jeszcze warto dodać dekorator i następnie w CSS odpowiednio rozmieścić opis:

  1. // dekoratory
  2. $this->setDecorators(array(
  3. 'ViewHelper',
  4. array('Label',
  5. array('requiredSuffix' => ': *', 'optionalSuffix' => ':')),
  6. [b]array('Description',
  7. array('tag' => 'div', 'class' => 'element-description')),[/b]
  8. array('Errors',
  9. array('tag' => 'div', 'class' => 'element-errors', 'placement' => 'prepend')),
  10. array('HtmlTag',
  11. array('tag' => 'div', 'class' => 'element-group')),
  12. ));
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 Aktualny czas: 19.08.2025 - 12:53