RedBeanPhp fuse with CI 2.1.0 HMVC

核能气质少年 提交于 2019-12-10 11:58:10

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!