Welcome Guest, Not a member yet? Register   Sign In
creating objects
#1

[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?


Messages In This Thread
creating objects - by El Forum - 09-19-2009, 07:49 AM
creating objects - by El Forum - 09-21-2009, 04:06 AM
creating objects - by El Forum - 09-21-2009, 04:09 AM
creating objects - by El Forum - 09-21-2009, 04:12 AM
creating objects - by El Forum - 09-21-2009, 01:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB