dphe5602 2018-02-05 15:10
浏览 48
已采纳

如何摆脱Zend Framework 3“入门”教程中的致命错误?

I have been trying to get through the "getting started" tutorial for Zend Framework 3. It has been going well, but once I get to "Forms and Actions" things stop working.

The tutorial is here: https://docs.zendframework.com/tutorials/getting-started/forms-and-actions/

This is the error I keep getting:

Fatal error: Declaration of Zend\Form\Form::bindValues(array $values = Array) must be compatible with Zend\Form\Fieldset::bindValues(array $values = Array, ?array $validationGroup = NULL) in ...\zendtest\vendor\zendframework\zend-form\src\Form.php on line 24

I get this after I have created AlbumForm.php, implemented InputFilterAwareInterface in Album.php, created the add.phtml view script and copied the needed logic in AlbumController.php. Everything has been copied from the tutorial.

I was not able to find anyone through Google that has had the same problem, so I must be doing something very wrong, but I can't see what it is.

Does anyone have an idea to what I could be doing wrong?

  • 写回答

1条回答 默认 最新

  • duankuaiwang2706 2018-02-05 19:21
    关注

    The error is caused by the mismatch of the definitions of the method "bindValues" between the child class "Zend\Form\Form" and its parent "Zend\Form\Fieldset".

    The definition of "Zend\Form\Fieldset" was changed since release 2.9.1(github link), but for "Zend\Form\Form" since release 2.11.0(github link).

    You probably have installed a release between those version >=2.9.1 and < 2.11.0. Run a composer update in your skeleton root to get the latest release(currently is 2.11.0) of Zend form package:

    composer update
    

    or

    php /path/to/composer.phar update
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog