问题
the controller
class User extends MX_Controller{
function __construct() {
parent::__construct();
}
function index(){
$r=R::dispense('group');
$r->GroupName="hh";
$i=R::store($r);
echo $i;
$r->hello();
}
}
the model
class Model_Group extends RedBean_SimpleModel{
function __construct() {
parent::__construct;
}
function open(){
echo "model";
}
function update(){
echo "update";
}
function hello() {
echo "hello";
}
}
the output it just returns the id neither the hook functions (open -update - etc........)nor the custom functions (hello) as mentioned from the redbean docs
so i am asking what's wrong or what i should do to work properly
回答1:
According to your code, I think you should load a model to fix this problem.
For example:
$this->load->model("module_name/model_name")
来源:https://stackoverflow.com/questions/10123540/redbeanphp-fuse-with-ci-2-1-0-hmvc