【发布时间】:2015-03-04 20:53:11
【问题描述】:
当我使用add_message("message",'success/danger'); 在我的数据库中插入数据时,我试图推送一条消息,即使查询正在数据库中添加数据,我也没有得到任何信息。
控制器:
function add_nino() {
$id_representante_submit = (int) $this->input->post('id_representante', TRUE);
if ($id_representante_submit > 0) {
$representante_data['id_representante'] = $this->input->post('id_representante', TRUE);
$representante_data['id_nino'] = $this->input->post('nino', TRUE);
$representante_data['id_parentesco'] = $this->input->post('parentesco', TRUE);
$result = $this->representante->add_nino($representante_data);
if($result){
add_message("Test", 'success');
} else {
add_message("Test1", 'danger');
}
}
$this->load->view('representante/add_nino_repre');
}
型号:
function add_nino($representante_data) {
$this->db->insert('nino_padre', $representante_data);
}
【问题讨论】:
-
add_message()是内部 Codeigniter 函数吗?它是在哪里定义的? -
我想您正在寻找一条消息?
-
我已经在另一个函数中使用了 add_message() 并且效果很好。
-
我看起来像那样(闪信)。
标签: php codeigniter model-view-controller