Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework] Form select
Eagle
post
Post #1





Grupa: Zarejestrowani
Postów: 170
Pomógł: 14
Dołączył: 16.03.2007

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


Nadpisałem domyślną klase Zend_Form_Element_Select (niby nic takiego - czyszczenie dekoratorów i używanie w nazwie "[]").
Jednak podczas renderowania dodawany jest parametr
Kod
<slect ... multiple="multiple">

Przy używaniu Zend_Form_Element_Select element wyświetla się poprawnie - lista jest rozwijana.
Widzi ktoś co przeoczyłem ?

Pozdrawiam

Element tworzę tak:
  1. $pole = new Abc_Form_Element_Select('pole');
  2. $pole->setMultiOptions($elementy)
  3. ->setRequired(true);

  1. class Abc_Form_Element_Select extends Zend_Form_Element_Select
  2. {
  3. /**
  4.   * Constructor
  5.   */
  6. public function __construct($spec, $options = null)
  7. {
  8. parent::__construct($spec, $options);
  9.  
  10. $this->clearDecorators();
  11. $this->addDecorator('ViewHelper')
  12. ->addDecorator('Errors');
  13. }
  14.  
  15. /**
  16.   * Set element name
  17.   */
  18. public function setName($name)
  19. {
  20. $name = $this->filterName($name, true);
  21.  
  22. if ('' === $name) {
  23. require_once 'Zend/Form/Exception.php';
  24. throw new Zend_Form_Exception('Invalid name provided; must contain only valid variable characters and be non-empty');
  25. }
  26. $this->_name = $name;
  27. return $this;
  28. }
  29. }
Go to the top of the page
+Quote Post

Posty w temacie


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: 22.08.2025 - 02:34