Bonjour à tous!

Suite à ce post:
http://www.developpez.net/forums/d94...laire-tableau/

J'ai fait quelques essais avec les méthodes addDecorator et setDecorators et je me suis aperçu d'un problème de rendu alors qu'il sont sensés rendre la même chose:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
        $form = new Zend_Form();
        $form->setDecorators(array(
            'FormElements',
            array('HtmlTag', array('tag' => 'table')),
            'Form',
        ));
            $foo = new Zend_Form_Element_Text("foo");
            $foo->setLabel("foo");
 
            // Cette ligne est censée rendre la même chose ...../.....
            $foo->addDecorator('HtmlTag', array('tag' => 'td'))
                ->addDecorator('Label', array('tag' => 'th'))
                ->addDecorator('ViewHelper', array('tag' => 'td'));
 
            // .../... Que celle-ci
            $foo->setDecorators(array(
                array('ViewHelper', array('tag' => 'td')),
                'Errors',
                array('Label', array('tag' => 'th')),
                array('HtmlTag', array('tag' => 'td'))
            ));
 
            $form->addElement($foo);
            $form->addDisplayGroup(array("foo", "group_foo");
 
            $group = $form->getDisplayGroup("group_foo");
            $group->setDecorators(array(
                        'FormElements',
                        array('HtmlTag',array('tag'=>'tr'))
            ));
 
// Ensuite dans la vue:
<?php echo $this->form; ?>
Si vous commentez une des deux lignes (addDecorator ou setDecorators) vous vous apercevrez que lorsque l'on utilise la methode setDecorators(), le champ input n'est pas englobé par les balises 'td'.

Est-ce un bug ou c'est moi qui comprend rien (...encore)?