CakePHP PaginationRecallComponent, Strict (2048): Declaration of PaginationRecallComponent::initialize()

主宰稳场 提交于 2019-12-02 04:30:19

You get this error because the signature of the initialize method in the PaginationRecallComponent class is different from the one in its parent class.

If you look at the code you will see that in Cake/Controller/Component.php the signature is:

public function initialize(Controller $controller)

whereas in the PaginationRecallComponent it is:

function initialize(&$controller)

In the first case the $controller parameter must be an instance of Controller, whereas in the second case there is no such constraint. To get rid of the error you simply have to add this constraint to the signature of the initialize method of the PaginationRecallComponent.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!