контроллер (wallow.php): < /p>
Код: Выделить всё
public function __construct()
{
parent::__construct();
$this->load->model('users_model');
}
public function index()
{
$this->users_model->getAll();
}
< /code>
Пользовательская модель (user_model.php): < /p>
class Users_model extends Base_model
{
public function __construct()
{
parent::__construct();
}
}
< /code>
Базовая модель (base_model.php): < /p>
class Base_model extends CI_Model
{
public function __construct()
{
parent::__construct();
$this->load->database();
}
public function getAll($table)
{
$query = $this->db->query('Query here');
return $query;
}
}
Подробнее здесь: https://stackoverflow.com/questions/423 ... eigniter-3
Мобильная версия