wie zum senden von Daten vom controller zum model mit CodeIgniter

ich bin Neuling mit CI und ich bin mit CI-v. 2.2.1, ich möchte die Daten aus meinem controller zu Modell, aber ich habe einige Probleme hier. Der Fehler, sagte mein Modell ist undefined property. hier ist mein code :

Controller :
users.php

public function postUser(){
    $username = $this->input->post('username');
    $password = $this->input->post('password');
    $email = $this->input->post('email');
    $phone = $this->input->post('phone');
    $address = $this->input->post('address');
    $level = $this->input->post('level');
    $status = $this->input->post('status');
    $this->load->model('model_crud');
    $query = $this->model_crud->insert('Users',$_POST);
    echo "$query";
}

Modell :
model_crud.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Model_crud extends CI_Model {
    public function __construct(){
         parent::__construct();
    }

    public function insert($table,$data){
        $query = $this->db->insert($table,$data);
        return $query;
    }
}

gibt es eine Konfiguration zu verwenden, Modell oder mein code ist falsch???
kann mir jemand helfen ? Thx

Schreibe einen Kommentar