PHP 警告:count(): 参数必须是数组或实现 Countable 的对象

PHP Warning: count(): Parameter must be an array or an object that implements Countable in

PHP 警告:count(): 参数必须是一个数组或一个在/opt/lampp/htdocs/deingreidcht/typo3conf/ext/toctoc_comments/pi1/class.toctoc_comments_pi1.php 中实现 Countable 的对象 如何解决这个问题

这是我的代码,我已经应用了条件,

if (count($rowsrf)== 0) {

你可以打错标准方法 例如在你的控制器中

$this->yourextRepository->findAll()->count();

希望这对您有所帮助!