我在我的services.ctp
文件中有这段代码,之前在CakePHP 2.3.10中工作正常.
href="<?php echo $this->webroot . 'intro/services/1'; ?>
Run Code Online (Sandbox Code Playgroud)
我刚刚将此文件复制到CakePHP 3.0.0中,它不再工作并抛出以下错误消息
错误:找不到C:\ apache2\htdocs\myprojxxxx\webroot\Helper.
$this->webroot
CakePHP 3.0中有什么不同之处?
请帮忙!
我有一个ProductsController,我在其中检索Products数据,还需要检索类别名称.(注意:我的Products表中只包含Category_ID),如何使用CakePHP模型关联来实现?
我见过一些示例,其中主数据表的ID(在我的情况下,Products表)是关联表中的外键.但是,我的情况略有不同,因为Category_ID(来自辅助表)是Main表(Products表)的一部分.
我无法使用CakePHP模型配置检索类别名称.你能帮我吗?
我的ProductsController在Products表上有
ID
Prod_Name
Category_ID
....
Run Code Online (Sandbox Code Playgroud)
我的类别表就像
ID
Cat_Name
Run Code Online (Sandbox Code Playgroud)
在我的ProductsController中,我想检索正在检索的产品的Cat_Name.