[eluser]timaksu[/eluser]
hey guys. when i go to save a post to my database, in the controller i do this:
Code:
$post->title = "title";
$post->date=now();
$post->content = "blablablalblab";
$this->post_model->save($post);
from which point the model does the rest however, i want to create an actual post object rather than what im doing above...an object with a constructor etc.
Code:
$post = new Post();
$post.set_title('title');
$post.set_content('content');
etc.
now i dont need to know how to write up all this..what i want to know is where would i actually place the code for this class? i need this class accessible everywhere ofcourse..so where?