Добрый день всем. Я пробую DATAMAPPER ORM (мастер wan) на Codeigniter. Пример приложения работает нормально. Но когда я пытаюсь сделать свои собственные модели и контроллеры, это не работает. Все шаги по инструкции сделал. Вот код:
class Blog extends DataMapper {
var $has_one = array();
var $has_many = array();
var $validation = array(
'content' => array(
// example is required, and cannot be more than 120 characters long.
'rules' => array('required', 'max_length' => 255),
'label' => 'Content'
)
);
function __construct($id = NULL)
{
parent::__construct($id);
}
}
Я создал таблицу в БД (блог с одной строкой, называемой контентом).
А вот и контроллер:
class Blog extends CI_Controller {
function __construct()
{
parent::__construct();
}
public function index()
{
$blog = new Blog;
$blog->content = "shaa";
$blog->save();
echo "done";
}
}
Но всегда выдает ошибку: Fatal error: Call to undefined method Blog::save() in C:\xampp\htdocs\wanwizarddatamapper\application\controllers\blog.php on line 29
Ууу меня это угнетает! Можешь мне помочь? Спасибо