Hello! I have some trouble figuring out if I should make the HTML inside of my class, of if stuff like that is done outside of the class? For some reason the code looks a lot better when you do it inside the classes, but of course they become heavy too. What do you guys do? And what would you recommend me to do? :o Thanks!
I recomend only using the class for handling the data. Then you have the HTML seperate(outside of the class), and feed the HTML with the data returned from the class.
Agreed. I think that's that is confusing about the power of OOP. It can really do almost anything you need it to do so where does one stop? If you think of it from an MVC point of view, you would keep the class for data usage only, while you keep the HTML/design separate.
Definetely keep it out. Just had a project some weeks ago, where all of the pagecontent was created in a class. It was such a mess, and it was almost impossible to maintain. It also kills your eyes when you need to find a certain point in that code-mess (No syntax-highlighting).
<a href="?post=1" title="Write an entry!" />Write an entry!</a>
<?php } ?>
Now, you can't see the advantage since the webeditor now has no syntax-highlighting on html, but when opening in eclipse or any similar IDE - it should show you also syntaxhighlighting on the html part. But as I said - I think i'ts not always the best way to do it - it depends on how much html do you have in comparison to the php code you have ;)
I'm beginning to think it might be better to film it as a lecture, what I'm writing just doesn't seem to be getting it though. So we might looking at a lot longer than a few days, this would take weeks. I'm wrote out an incomplete powerpoint to go with it and it is 25 slides already. This could be over an hour of me talking. Doing this would be harder, but probably be the best tutorial I've done.