Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'ve been using PHP Frameworks for so long that I\'ve actually forgot the \"bes

ID: 651587 • Letter: I

Question

I've been using PHP Frameworks for so long that I've actually forgot the "best practices" for create websites without one.

Usually I will use Symfony, or more recently I've been using Laravel. A client wants a very simple website, but with certain parts of it dynamic. Due to the nature of the site using Wordpress, or a Framework, is out of the question.

I'm a sucker for priding myself on my code, but I feel like I'm asking such a basic question that it's killing me to ask. But, what are the best practices for creating websites without a Framework?

I like to live by the K.I.S.S (Keep It Simple Stupid!) method of thinking. So, my idea was to just create the .php pages that are required, do any page processing or database interaction on that page, then have the HTML below the closing PHP tag. I would have any helpers/functions in a functions.php file. This is what I remember doing way before I was using Frameworks, and to me it seems like a very old school way of doing things.

I've not created a site without a Framework for literally 2+ years, so I've lost my way with the basics.

Any advice would be greatly appreciated.

Explanation / Answer

You have used Symfony. That is perfect for your need. If you used Symfony, than you will know that you don't need to use all it's components. Quite the opposite is the case. You can basically use each of it's components standalone.

That being said I'd recommend you that you stick with what you know. And even if you would do it without a framework, you would end up with recreating all the stuff a framework already does. It has a reason why frameworks use database abstraction and other forms of abstraction. It makes code much more maintainable.

Going back to the very bad style of programming where you put everything in one php file, is not the solution. It has been never the solution and will never be. People believe it might be basic or quick but in the end it is only a messy code that nobody can maintain.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote