error Translator

Home Forums Learn ZF2 error Translator

This topic contains 2 replies, has 3 voices, and was last updated by  Giuseppe Franceschini 3 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #233

    In the Register, this i the error:

    Warning: Illegal offset type in /var/www/learnzf2/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php on line 441

    What is the problem.

    Regards

    #237

    admin
    Keymaster

    I guess the translator tries to provide a translation for a string that does not have translation yes. If you want to fix the issue you can add the translation for this string. That is something that is done usually in the last phase of the project development before a release.

    #253

    The reason of the warning “Warning: Illegal offset type in …” is that csrf has a null label.

    To solve I had to insert an option ‘label’ to it with a void string.

    $this->add(array( 
                'name' => 'csrf', 
                'type' => 'Zend\Form\Element\Csrf', 
                // add this 
                'options' => array(
                    'label' => "",
                )
    ));

    Bye.
    Giuseppe

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.