0

我在这个错误中挣扎了几个小时。错误日志消息没有太大帮助。

我有一个带有 index() 操作的控制器sitesController.php 。我还有一个Template/admin/reports/index.ctp,如果我添加 debug fn dd('hi') 我可以看到“hi”消息,这意味着视图自动发现它工作正常吗?但是如果我删除这个 dd() fn 我会看到这个错误:

2022-01-03 06:17:21 Error: [Cake\Routing\Exception\MissingControllerException] Controller class Webroot could not be found. (/var/www/html/vendor/cakephp/cakephp/src/Http/ControllerFactory.php:105)
Exception Attributes: array (
  'class' => 'Webroot',
  'plugin' => false,
  'prefix' => false,
  '_ext' => false,
)

站点控制器.php

  public function index()
{

    $this->set(['page' => $pages, 'total' => $total]);
}

/admin/reports/index.ctp 这个简单的代码会引发错误。

   <div class="rows">
    <h2>hello world!</h2>
    </div>

但是此代码显示“嗨”消息

 dd('hi');

任何线索如何处理?谢谢。

4

0 回答 0