OOP PHP - Simple CRUD and Creative Block System

Asked

Viewed 1,676 times

0

I am studying Object Orientation applied to PHP and I am getting lost in the basics; it does not enter my mind how to organize scripts and classes. I studied Java OO and I have no major problems, but I started my studies in PHP in procedural form and now I can’t understand how it works, for example, the class containing the 'main', in Java, responsible for making it work; how it happens in PHP.

I am creating a simple application of CRUD, containing:
- A welcome page;
- A Login page;
- And while logged in, you will have access to a registration page, and an update of records.

I have read several codes, articles and tutorials on OOP PHP, but my mind is blocked to understand this.

What would be the best PHP programming practices to create this application? A separate connection script or integrated into the pages? Use abstraction or not? (Users with access would have equal permissions to register and update entries). All files in the same folder, or all separate, even if it is a learning-only project?
I read a little about MVC, it’s useful to study in depth?

How would you do that?

  • 1

    Just a note, in Java you do not have such problems because it "already comes" with technologies for such, PHP is more free for you to create the "things" the way you prefer. I recommend you start using an existing framework for PHP, suggestions: Laravel, cakephp, codeigniter. I

1 answer

2


It is certainly useful to study MVC, I started studying and I am already developing a system based on it. I even posted a question here at the beginning because in fact it gives a big knot in the head to assemble the logic, but after you see the system is very clean and organized. I recommend the following tutorial, in it you have what you need for your question:

http://www.tutsup.com/2014/09/17/mvc-em-php-parte-1/

Maybe you’ve even seen it around, but I think it’s a good example to start.

A free tip: Just look at the logic of the system, you don’t have to stick to it rigorously, you’ll have things that will be easier to do your way using their logic.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.