Good day to all. I am trying DATAMAPPER ORM (wan wizard) on Codeigniter. Example aplication works fine. But when I try make my own models and controllers it doesn't work. I did every step in the instruction. Here is a code:
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);
}
}
I created table in db (blog with one row called content).
And here is a controller:
class Blog extends CI_Controller {
function __construct()
{
parent::__construct();
}
public function index()
{
$blog = new Blog;
$blog->content = "shaa";
$blog->save();
echo "done";
}
}
But it always gives me an error: Fatal error: Call to undefined method Blog::save() in C:\xampp\htdocs\wanwizarddatamapper\application\controllers\blog.php on line 29
Uuhh it's depresing me! Can you help me? Thank you