Page 1 of 1
Learning Classes
Posted: Thu Jun 02, 2011 3:27 pm
by EcazS
I looked at some PHP Classes earlier today and realized I didn't understand anything of it at all, so I watched some videos on classes and now I understand a little bit more, hooraay!
BUT I really wanna learn classes but I have nothing to do except my full blown CMS that I was going to do later this year
Any ideas on what you could create just to learn? Could be simple stuff (preferably)
Re: Learning Classes
Posted: Thu Jun 02, 2011 3:34 pm
by Tino
You mean you want to learn object-oriented programming.
What you could try to do? I don't really know. Just try to convert something you created earlier to use OOP instead?
Re: Learning Classes
Posted: Thu Jun 02, 2011 3:38 pm
by EcazS
Tino wrote:You mean you want to learn object-oriented programming.
So that's what that is
I feel really stupid right now....*cough*
All I have locally is this stupid contact form
Re: Learning Classes
Posted: Thu Jun 02, 2011 3:40 pm
by jacek
There is no point doing it just for the sake of it. You need a good example of how it can be better to use classes. I will do some videos on this when I get my mic working
Just to know how they work you can just make anything at all really. If you have a login system for your site, replace all of the functions with methods in a class.
EcazS wrote:So that's what that is
I feel really stupid right now....*cough*
It's just what it's called, you create an instance of a class with the new keyword
$class = new class();
The $class variable is now an object.
Re: Learning Classes
Posted: Thu Jun 02, 2011 3:44 pm
by EcazS
jacek wrote:I will do some videos on this when I get my mic working
I like what I see, when will that be?
jacek wrote:
$class = new class();
The $class variable is now an object.
I knew that much
Re: Learning Classes
Posted: Thu Jun 02, 2011 4:06 pm
by jacek
EcazS wrote:I like what I see, when will that be?
No idea, I will try to fix my mic input tomorrow after my
last exam (
) If it works then I will just keep this slightly worse headset and use it to make about a million videos next week.