Hi Matthew - I have added an element to a form using the 'factory' method and set the 'class' attribute by passing options to the method. If I inspect the object with var_dump I can see a public property of 'class'. But if I try $element->getAttribs() I get an empty array.

        $this->addElement('button', 'submit', array(
            'value' => 'submit',
            'class' => 'next',
            'decorators' => array(
                array('ViewHelper', array(
                    'helper' => 'formButtonImage',
                    )),
            ),
        ));

        var_dump($this->getElement('submit'));
        var_dump($this->getElement('submit')->getAttribs());

I can see that the reflection class has been used to derive all the public properties but this seems to be a bit buggy on PHP 5.1.6. Could all 'public' attributes not instead be placed into a protected array called _attribs instead? It would reduce the need for the overhead of the reflector and be somewhat more flexible for people like me who can't yet migrate to 5.2.x

Cheers!

--

Simon Mundy | Director | PEPTOLAB

""" " "" """""" "" "" """"""" " "" """"" " """"" "  """""" "" "

202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124
http://www.peptolab.com

Reply via email to