Ideas for simple objects for everyday use by web developers?

Dang-I know this is a subjective question, so it will probably be downloaded / blocked, but I will try anyway, because I don’t know where else to ask (feel free to point me to the best place to ask this!)

I just envelop my head with PHP, but I still do not use frameworks or anything else.

I would like to create some small simple objects that I could use on my own sites in order to better feel them.

Can someone recommend a list or resource that could tell me to tell you 10 daily objects that people will use on major websites?

I ask because I'm a little embarrassed. For example, I was thinking about the "database connection" object, but then I just think it's just a function, not an "object"

So the question is:

What are some examples of objects used on basic PHP websites (not including shopping cart sites)

Thank!

+3
source share
3 answers

Here are a few basic reusable objects you might have:

  • Session (cookie specific, server side stored)
  • User (username, password, etc.)
  • DBConnection (yes, it could be an object)
  • Comment (allows users to comment on things)

, -, . . , , .

+4

, HTML CSS, :

  • WebForm. . . getHTML(), , . , POST. ; , . , . , . , , (, ). ( , ).
  • BaseFormElement, , EmailElement, PhoneElement .. getHTML(), WebForm:: getHTML() . validate(), WebForm:: validate() getData(), .

. : p

+3

, - SQL- . , .

/ - . ( ...), :

" API "

If any of the methods in your data access class do something else, then you know that they belong somewhere else.

+1
source

Source: https://habr.com/ru/post/1745542/


All Articles