php - Help Understanding Object Orientend Programming OOP -
i've been reading oop on several websites & looking though (so , find hard find shows decent example of full oop php application. give examples using cars doesn't resonate me in regards putting actual use 1 day.
can show me full example off oop used in real website scenario. know may asking lot help.
or there diagram somewhere shows real life relationship between methods, classes, objects, constructors etc.
i know it's not simple explain appreciate attempt.
thanks in advance
what if change "car" little more familiar on web?
$post = new blogpost(); $post->settitle($_post['title']); $post->setbody($_post['body']); $post->settags($_post['tags']); $post->save();
same idea. have blogpost class encapsulates representation , manipulation of blog posts. hides things turning comma-separated list of tags user separate rows in tags table when saving post, , how post saved. switch saving them text files saving them in database without changing code above read or write posts.
Comments
Post a Comment