Originally Posted by
moodsey211
take for example if gamay ra kaayo ang code nga needed nimong i-balik balik. instead of making a class just of a few lines of codes, mas favorable if imo na lang siyang himuan ug function.
Exactly. Use what is only needed to finish a job. In short, use the right tool for the right job.
It's been awhile since I played PHP so I'm not sure how much PHP5 OOP concepts (PHP5 has the proper implementation of OOP, PHP < 5 OOP all sucked ) creeped into the PHP programming nowadays. So many frameworks have done a great job streamlining the processes of requests, e.g. mapping a url "/blogread/1234" to a function of a controller called Blog->Blog_Read($id) which seems to suggest it is breaking the sequential straightforward programming that we used to. Before, I'm following a kind of standard coding like this:
PHP Code:
<?php
//all php code
?>
<html>
<!-- all html code here with mixed php -->
<?= $variable ?>
</html>
So if it worked OK before, then I don't see the reason changing it now. Unless you are constrained by the framework to use OOP or your business model is so large it requires you to.