使用 $foreign_keys 或 $belongs_to 时 FUEL-CMS 模块文件位置问题
FUEL-CMS module file location issue while using $foreign_keys or $belongs_to
您好,我正在尝试使用 $foreign_keys 功能,如下所示
public $foreign_keys = array('continent_id' => array(FUEL_FOLDER => 'continents_model'));
但出现错误
An Error Was Encountered
Unable to locate the file: continents_model.php
我尝试使用 $belongs_to
时发生了同样的事情
这些模块的位置是:
\fuel\modules\packages\models
\fuel\modules\continents\models
我的文件夹结构如图所示
我的模型代码如下
我应该做什么更改才能获得模型路径
我认为问题在于使用 FUEL_FOLDER 而不是模块名称。请尝试以下操作:
public $foreign_keys = array('continent_id' => array('continents' => 'continents_model'));
您好,我正在尝试使用 $foreign_keys 功能,如下所示
public $foreign_keys = array('continent_id' => array(FUEL_FOLDER => 'continents_model'));
但出现错误
An Error Was Encountered Unable to locate the file: continents_model.php
我尝试使用 $belongs_to
这些模块的位置是:
\fuel\modules\packages\models
\fuel\modules\continents\models
我的文件夹结构如图所示
我的模型代码如下
我应该做什么更改才能获得模型路径
我认为问题在于使用 FUEL_FOLDER 而不是模块名称。请尝试以下操作:
public $foreign_keys = array('continent_id' => array('continents' => 'continents_model'));