How to write a PHP class (Appendix: video course address)

Source: Internet
Author: User
How to write a PHP class (Appendix: video course address) and think about it in one minute, how to write a PHP class ?................................. ........................................ ................. How to write a PHP class (Appendix: video course address)

Take a minute to think about 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. 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.

========================================================

========================================================

We have been preparing for this in the past few weeks and have completed the first three releases. the content is as follows:

Http://wenku.baidu.com/course/view/7cea0975f46527d3240ce003

Section 1: Basic development environment

Section 2: Test-driven development

Section 3: Principles and development of the test base class


In addition, the following sections are being prepared, including:

Section 4: configuration file management class: Conf -- This section teaches you how to use test-driven development.

Section 5: reading and writing CSV data files: Csv-This section teaches you how to use exceptions.

Section 6: common verification methods: Validate -- This section teaches you how to use multi-level subclass

Section 7: data hashing: SData-This section describes common data hashing scenarios.

Section 8: writing database connector: SDB -- This section describes how to use parameter control configuration.

Section 9: how to introduce a third-party class: Smarty -- use proxy

Section 10: parse your comments to make them structured-more complex integrated package development


==========================================================

If you want to present any knowledge points in the form of practice, you can leave a message for me ~~ I will try my best to satisfy the problem. maybe my solution is not the best, but I will also give a thought. You are also welcome to give me your own ideas. of course, you can also contribute (it seems that there is no draft fee, but it is no problem to declare the author). thank you ~~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.