带CI 2.1.0 HMVC的RedBeanPhp保险丝 [英] RedBeanPhp fuse with CI 2.1.0 HMVC

查看:106
本文介绍了带CI 2.1.0 HMVC的RedBeanPhp保险丝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

控制器

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();
    }
}

模型

class Model_Group extends RedBean_SimpleModel{
    function __construct() {
        parent::__construct;
    }
    function open(){
        echo "model";
    }
    function update(){
        echo "update";
    }
    function hello() {
        echo "hello";
    }
}

输出 它只是返回id,既没有钩子函数(open -update-etc ...),也没有返回自定义函数(hello),如redbean docs中所述

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

推荐答案

根据您的代码,我认为您应该加载一个模型来解决此问题.

According to your code, I think you should load a model to fix this problem.

例如:

 $this->load->model("module_name/model_name")

这篇关于带CI 2.1.0 HMVC的RedBeanPhp保险丝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆