Jump to content

Zend Framework error, array to string conversion , implode


colap

Recommended Posts

If i click the login link i get error =>

 

    Notice: Array to string conversion in /var/www/site/library/Zend/View/Helper/HtmlElement.php on line 104 

    Call Stack: 
    0.0003 335540 
    1. {main}() /var/www/site/public/index.php:0 0.0682 4242800 
    2. Zend_Application->run() /var/www/site/public/index.php:26 0.0683 4242800 
    3. Zend_Application_Bootstrap_Bootstrap->run() /var/www/site/library/Zend/Application.php:366 0.0684 4242872 
    4. Zend_Controller_Front->dispatch() /var/www/site/library/Zend/Application/Bootstrap/Bootstrap.php:97 0.0789 4866464 
    5. Zend_Controller_Dispatcher_Standard->dispatch() /var/www/site/library/Zend/Controller/Front.php:954 0.0867 5201824 
    6. Zend_Controller_Action->dispatch() /var/www/site/library/Zend/Controller/Dispatcher/Standard.php:295 0.1095 6672344 
    7. Zend_Controller_Action_HelperBroker->notifyPostDispatch() /var/www/site/library/Zend/Controller/Action.php:523 0.1095 6673344 
    8. Zend_Controller_Action_Helper_ViewRenderer->postDispatch() /var/www/site/library/Zend/Controller/Action/HelperBroker.php:277 0.1096 6673344     
    9. Zend_Controller_Action_Helper_ViewRenderer->render() /var/www/site/library/Zend/Controller/Action/Helper/ViewRenderer.php:957 0.1107 6673592 
    10. Zend_Controller_Action_Helper_ViewRenderer->renderScript() /var/www/site/library/Zend/Controller/Action/Helper/ViewRenderer.php:918 0.1107 6673592 
    11. Zend_View_Abstract->render() /var/www/site/library/Zend/Controller/Action/Helper/ViewRenderer.php:897 0.1108 6714828 
    12. Zend_View->_run() /var/www/site/library/Zend/View/Abstract.php:880 0.1109 6716384     
    13. include('/var/www/site/application/views/scripts/index/login.phtml') /var/www/site/library/Zend/View.php:108 0.1133 6810172 
    14. Zend_Form->__toString() /var/www/site/library/Zend/Form.php:0 0.1133 6810172 
    15. Zend_Form->render() /var/www/site/library/Zend/Form.php:2903 0.1168 6970720 
    16. Zend_Form_Decorator_FormElements->render() /var/www/site/library/Zend/Form.php:2887 0.1336 7588600 
    17. Zend_Form_Element->render() /var/www/site/library/Zend/Form/Decorator/FormElements.php:101 0.1345 7590872 
    18. Zend_Form_Decorator_ViewHelper->render() /var/www/site/library/Zend/Form/Element.php:2020 0.1362 7609432 
    19. Zend_View->formPassword() /var/www/site/library/Zend/Form/Decorator/ViewHelper.php:246 0.1362 7609880 
    20. Zend_View_Abstract->__call() /var/www/site/library/Zend/View/Abstract.php:0 0.1362 7610208 
    21. call_user_func_array() /var/www/site/library/Zend/View/Abstract.php:342 0.1362 7610656 
    22. Zend_View_Helper_FormPassword->formPassword() /var/www/site/library/Zend/View/Abstract.php:0 0.1365 7613744 
    23. Zend_View_Helper_HtmlElement->_htmlAttribs() /var/www/site/library/Zend/View/Helper/FormPassword.php:89 0.1365 7614364 
    24. implode() /var/www/site/library/Zend/View/Helper/HtmlElement.php:104 

Can anyone tell why am i getting this error?

 

And how can i solve it ?

 

 

    public function loginAction() {
        $obj = new Application_Form_Login();

        $request = $this->getRequest();
        if ($request->isPost()) {
            if ($obj->isValid($request->getPost())) {
                if ($this->_process($obj->getValues())) {
                    $this->_helper->redirector('arcade', 'index');
                }
            }
        }
        $this->view->form=$obj;
    }

Login form =>

 

    <?php
    
    class Application_Form_Login extends Zend_Form
    {
    
        public function init()
        {
    		$this->setName("login");
    		$this->setMethod("post");
    
    		$temp=array(array('StringLength',false,array(0,50)));
    
    		$this->addElement('text','usr',array(
    			'filters'=>array('StringTrim','StringToLower'),
    			'validators'=>$temp,
    			'required'=>true,
    			'label'=>'Username',
    		));
    
    		$this->addElement('password','psw',array(
    			'filters'=>array('StringTrim'),
    			'validator'=>$temp,
    			'required'=>true,
    			'label'=>'Password',
    		));
    
    		$this->addElement('submit','log',array(
    			'required'=>false,
    			'ignore'=>true,
    			'label'=>'Login',
    		));
        }
    
    }

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.