-- Gabby403 <[email protected]> wrote
(on Monday, 20 July 2009, 03:32 AM -0700):
> 
> $decorators2 = array(
>     'ViewHelper',
>     'Description',
>     'Errors',
>     array(

Your problem is with the above -- you're attempting to define a single
decorator as an array of decorators. Just remove the above "array("
declaration (and the matching closing paren after the final decorator),
and you'll be fine.

>         array('data' => 'HtmlTag' ), array('tag' => 'span' ),
>         array('Label', array('tag' => 'span' )),
>         array(array('row' => 'HtmlTag' ),array('tag' =>'div','style' =>
> 'display:none;', 'class' => 'hiddenToReveal'))
>     )
> );

To be 100% clear, define $decorators2 as follows:

    $decorators2 = array(
        'ViewHelper',
        'Description',
        'Errors',
        array('data' => 'HtmlTag' ), array('tag' => 'span' ),
        array('Label', array('tag' => 'span' )),
        array(array('row' => 'HtmlTag' ),array('tag' =>'div','style' =>
            'display:none;', 'class' => 'hiddenToReveal')),
    );


> $var = $this->createElement($type, $name);
> $var->setLabel($label);
> $var->setRequired($required);
> $var->setOptions($properties);    
> $var->setDecorators($decorators2);
> $this->addElement($var);
> 
> doing this in my form gives me this error
> Catchable fatal error: Argument 4 passed to
> Zend_Dojo_View_Helper_ValidationTextBox::validationTextBox() must be an
> array, null given in
> /home/gabriel/public_html/gomad_test/library/Zend/Dojo/View/Helper/ValidationTextBox.php
> on line 64
> Commenting out the setDecorators line makes everything work fine, but
> obviously without my decorators, leaving that line in and commenting out the
> others still displays the error, so it would seem to be my decorators, but I
> can't see anything wrong with them. Please help.

-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/

Reply via email to