How to learn laravel? There are some things that you can understand when you see them at the time, but you don’t understand them the next time you encounter them.
Interest is important
This is an old topic. In fact, it is not that interest is the best teacher, but if you are not interested, you will be very annoyed when learning. Because programming is actually a very complicated thing. The project is large and has many details, and no mistakes are allowed in the details. Sometimes a small bug can torture you for several days. If you were not interested in programming, you would have collapsed long ago. As a programmer, the concept I should have is that programming makes me happy, and I can gain financial income while gaining happiness. Therefore, if you are not interested, it is recommended to change careers as soon as possible.
Exploration spirit and fearless spirit
Among laravel learners, it is estimated that not many have read the complete source code once. Don't think the source code is difficult to understand. The author has written a lot of comments, many of which cannot be seen in the document. A careful look at the source code will bring you a lot of inspiration and gains. Learning requires a spirit of exploration. Many students around me just listen to it during class and know what it is, but don’t think about why, what it can do, and how it is related to other knowledge. Fearless spirit refers to being fearless of authority, and at the same time, one should not regard oneself as humble. You must know that although you are not an authority, you are on the way to authority. If those people can do it, you can also do it. In the laravel group, I see a lot of people asking questions and asking for help from a great god. Be humble when asking for advice, but don’t think of yourself as too humble. They are just one step ahead of you. Gods are for worship, and it is impossible for humans to become gods. If you regard this level as a god, it will be difficult to achieve it. So, go look at the laravel source code and think of it as a framework you wrote a few years ago. Then you lost your memory and now you just look at your past works.
Methodology
The above is relatively vague and talks about general learning attitude methods. Let’s talk about something specific below. Of course, learning methods vary from person to person, but here are just the general ones.
Lay a solid foundation
The laravel framework is a relatively high-level PHP framework. It is best to have a certain foundation before learning.
Know what communication is and what protocol is. Understand the iso reference model. Understand the http protocol, what is a browser, what are links and web pages. Don't underestimate these concepts. Can you explain these concepts clearly to a liberal arts student? What is php used for, and what role does it play in the web workflow? What about laravel, what is it, why does it exist, and what can it bring.
After you figure out what you are doing and what role you play in the entire web, you can start learning
Learn PHP basic syntax and standard library. Learn design patterns and commonly used algorithms. Use native PHP to develop a small project to advance to PHP. Be familiar with "modern php" Concepts (documents and some tutorials) Understand the laravel framework operation process, framework design ideas (important) and practical development. Don’t rush to search to solve bugs. First find the cause based on the error and exception call stack. You can read the source code briefly to locate the problem. After solving several bugs, you may have read half of the framework source code. Read the source code
Read the source code
Specially talk about the method of reading the source code. Laravel source code naming follows semantic rules, and most class names, variable names, and function names have visible names and meanings. Read it from the overall perspective to the details. Start with index.php and understand what each function or class does. Once you finish going through the details, you will know why. That is, traverse the tree below in a breadth-first manner (this is incomplete, just an example to show you the method, you can do it yourself)
laravel tree
Cultivate thinking Only by learning how to study can you get twice the result with half the effort. Only by understanding can we remember deeply.
happy hacking~For more laravel related technical articles, please visit the laravel framework introduction
column to learn!The above is the detailed content of How to learn laravel. For more information, please follow other related articles on the PHP Chinese website!