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 不小心不正规的开发公司导致不给我们y码,
  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000
  • ¥30 ppOCRLabel导出识别结果失败
  • ¥15 Centos7 / PETGEM
  • ¥15 csmar数据进行spss描述性统计分析
  • ¥15 各位请问平行检验趋势图这样要怎么调整?说标准差差异太大了
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿