摆脱PHP中的通知

时间:2010-08-17 15:54:28

标签: php zend-framework notice

我正在创建一个使用Zend Framework版本1.10.7。但是我得到了一个令人烦恼的通知,我想要让他去玩。通知意味着我有一个数组的问题。我只是无法找到它的位置。 任何帮助,想法?

     Notice: Array to string conversion in /var/www/Zend/ZendFramework-1.10.7/library/Zend/View/Helper/HtmlElement.php on line 104
Call Stack
#   Time    Memory  Function    Location
1   0.0003  327592  {main}( )   ../index.php:0
2   0.0011  336304  require( '/var/www/nrka2/application/application.php' ) ../index.php:2
3   0.3390  6787492 Zend_Application->run( )    ../application.php:24
4   0.3391  6787492 Zend_Application_Bootstrap_Bootstrap->run( )    ../Application.php:366
5   0.3399  6787564 Zend_Controller_Front->dispatch( )  ../Bootstrap.php:97
6   0.3559  7143808 Zend_Controller_Dispatcher_Standard->dispatch( )    ../Front.php:954
7   0.7416  10514760    Zend_Controller_Action->dispatch( ) ../Standard.php:295
8   0.7429  10520540    Zend_Controller_Action_HelperBroker->notifyPostDispatch( )  ../Action.php:523
9   0.7432  10521780    Zend_Controller_Action_Helper_ViewRenderer->postDispatch( ) ../HelperBroker.php:277
10  0.7438  10521780    Zend_Controller_Action_Helper_ViewRenderer->render( )   ../ViewRenderer.php:957
11  0.7505  10522008    Zend_Controller_Action_Helper_ViewRenderer->renderScript( ) ../ViewRenderer.php:918
12  0.7508  10522008    Zend_View_Abstract->render( )   ../ViewRenderer.php:897
13  0.7512  10563268    Zend_View->_run( )  ../Abstract.php:880
14  0.7515  10564596    include( '/var/www/nrka2/application/modules/eventManager/views/scripts/user/register.phtml' )  ../View.php:108
15  0.7516  10564596    Zend_Form->__toString( )    ../Form.php:0
16  0.7516  10564596    Zend_Form->render( )    ../Form.php:2903
17  0.7554  10565984    Zend_Form_Decorator_FormElements->render( ) ../Form.php:2887
18  0.7982  10778164    Zend_Form_Element->render( )    ../FormElements.php:101
19  0.8043  10780436    Zend_Form_Decorator_ViewHelper->render( )   ../Element.php:2020
20  0.8135  10814136    Zend_View->formText( )  ../ViewHelper.php:246
21  0.8136  10814584    Zend_View_Abstract->__call( )   ../Abstract.php:0
22  0.8139  10814912    call_user_func_array ( )    ../Abstract.php:342
23  0.8139  10815356    Zend_View_Helper_FormText->formText( )  ../Abstract.php:0
24  0.8158  10818276    Zend_View_Helper_HtmlElement->_htmlAttribs( )   ../FormText.php:79
25  0.8161  10818896    implode ( ) ../HtmlElement.php:104

更新

我发现这段代码给我带来了麻烦:

$this->addElement('text','usr_surname', array(
        'valdators' => array(
            'Alpha',
                array('StringLength',true,array(3,128))
        ),
        'required'  =>  true,
        'label'     => 'lastname',
        'filters'   => array('StringTrim')
        ));

2 个答案:

答案 0 :(得分:2)

你错误的'验证者':

$this->addElement('text','usr_surname', array(
        'validators' => array(
            'Alpha',
                array('StringLength',true,array(3,128))
        ),
        'required'  =>  true,
        'label'     => 'lastname',
        'filters'   => array('StringTrim')
        ));

答案 1 :(得分:1)