我的 services.ctp
中有这段代码在 CakePHP 2.3.10 之前运行良好的文件。
href="<?php echo $this->webroot . 'intro/services/1'; ?>
我刚刚将此文件复制到 CakePHP 3.0.0 中,但它不再工作并抛出以下错误消息
Error: C:\apache2\htdocs\myprojxxxx\webroot\Helper could not be found.
这有什么不同
$this->webroot
在 CakePHP 3.0 中?请帮忙!
最佳答案
你需要使用这个:
href="<?php echo $this->request->webroot . 'intro/services/1'; ?>
这将适用于 cakephp 3.0
关于cakephp - 如何让 $this->webroot 在 CakePHP 3.0 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29216856/