How to write a PHP class ?. Well, it sounds very easy, but it is not easy to operate. A few days ago, I talked to the technical director of a company about the application of PHP object-oriented in the company.
Well, it sounds very easy, but it is not easy to operate. A few days ago, I talked to the technical director of a company about the application of PHP object-oriented in the company. The reason is simple, and there is no mandatory reason for you to use objectized PHP. Not only that, but you need to understand one thing. the object-oriented threshold is not low, but the threshold for PHP is very low.
I admit that he is right. Based on my experience over the past few years, many people only understand the basic syntax of PHP class, but some core ideas, such: class creation principles, design patterns, etc. the use of these theoretical knowledge does not have a certain amount of time experience can not really understand. Our troubles are as follows:
1. why?
2. the threshold is high. how can we stick to it?
3. Use cases
4. what are the advantages? why do I have to use the object method to accomplish things using the process method?
Unfortunately, every book that targets objects has an answer. But do we really understand?
We are working on course products. Therefore, I plan to give a practical example of how to use object-oriented courses in the PHP environment. I expect this course to be very easy to use, so I also write it very easily:
1. Introduction to the environment
2. each time you use an instance to explain a small Knowledge Point
3. release all source code to github for sharing
4. the class library can be used directly and updated regularly.
This is an idea, and of course it needs to be implemented.
Bytes. A few days ago, I talked to the technical director of a company about the application of PHP object-oriented in the company...