Jump to content

A Blog with PHP OOP?


glassfish

Recommended Posts

I have looked around. And what I came across was not necessarily what I was looking for.

 

I was wondering if somebody can recommend a good tutorial for building a blog in PHP OOP?

 

Also, I was wondering if somebody perhaps knows a good blog app written in PHP OOP, where I could be learning from  the script files?

Link to comment
Share on other sites

Well I found a good tutorial series on YouTube out of those multiple ones which are there. And I haven gotten into OOP and bind parameters ("PDO"). And I am quite liking it, it looks like that one is indeed typing less and one has set up a blog ("CRUD") quite quickly. Before that I have had also suspected the less amount of code with OOP, I was not quite sure when it comes to this, I thought maybe the request calls are written a bit shorter and that may be it when it comes to this.

 

I feel like I could be learning from "full" blog web apps written with OOP and bind parameters, yet I also feel a bit sad about it, that I am not coming across a bunch of scripts on the internet. I will look a bit later on Themeforest for this.

 

I still would appreciate suggestions on this. I am really looking to know OOP with bind parameters better.

Link to comment
Share on other sites

PDO isn't 'bind parameters'.  It's a database abstraction layer.  The point of PDO is that it allows one to write database queries without caring about the actual database you're using.  PDO code should be able to be used in a MySQL database, PostgreSQL database, SQLite database, etc. with little to no modification.  That's the whole point behind it.  It makes code modular, and separate from the underlying mechanisms, which is one of the major reasons why people write OO code.  Prepared statements are a separate nicety.  Useful, to be sure, but not why PDO exists.

 

Regarding the size of OOP code, it tends to be a bit overkill for small projects.  There's generally a lot of overhead in creating/moving objects around, which makes it not worth it.  OOP is built for complexity.

 

But, yeah... 'bind parameters' isn't a thing to keep harping on.  It's a secondary, rudimentary mechanism.  Like I said in the other thread, it's like going "Oooh, arrays!"  Potential employers will look at you funny if you gush/brag about them.  In professional settings, existing libraries and frameworks (like Doctrine) take care of that (prepared statements, binding parameters) for you anyway.

  • Like 1
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.