Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

creating a oop php blog

Tags:

oop

php

Hi Im trying to develop a oop php driven blog. Im new to the oop way in php so its going quite slow. I have a class BlogPost were I have created the private variables for the rows in my blog field in he db and getters and setters for them example:

function getCreated() {
    return $this-$created;
}

function setCreated($created) {
     $this->$created = $created;
}

is this the way to do it?! I think Im on the right track but Im not sure. Do anyone have any input?! maybe some tips on good tutorials on how to create a blog oop php style. Found one at net.tuts but Im not really liking it. Thanks!

Regards

like image 446
Tim Avatar asked Jul 16 '26 00:07

Tim


1 Answers

You are close, try

function getCreated() {
    return $this->created;
}

function setCreated($created) {
     $this->created = $created;
}
like image 162
Zoidberg Avatar answered Jul 17 '26 15:07

Zoidberg