I have been learning PHP myself before. because I have received JAVA training before, it is easy to learn PHP, during the course of study, I rented a space and learned to make a small site that I was interested in. from the page structure, style, and program implementation, I used Editplus myself.
At the end of March, I received an internship notice from my favorite company and officially started my work in April 1.
I have been learning PHP myself before. because I have received JAVA training before, it is easy to learn PHP, during the course of study, I rented a space while learning and made a small site of interest to myself. from the page structure, style, and program implementation, I wrote it by myself using Editplus in a row and line, although the technical content is very low, I also moved a lot of brains and checked a lot on the Internet. The first version is a process-oriented hybrid page. after that, I learned the Smarty template by myself, realizing the separation between the presentation layer and the logic layer, and realizing a sense of accomplishment.
The company uses the ThinkPHP framework. when it got there, it gave me a task named EDM, but the time was not too short. it gave me a lot of time to access the tools used by the company. The boss showed me ThinkPHP quick start. at first two days, ThinkPHP was always in the fog and I couldn't understand it at all. now I know that I ignored an important thing --- MVC, this framework can be viewed quickly using the MVC idea. in the next few days, you can view the company code while reading the entry, finally, within a week, I understood the operating mode and structure of the entire framework, and the rest was just an application.
My understanding of ThinkPHP is as follows:
1. Action in the directory structure is the Control layer in MVC; Model is the Model layer in MVC, and Tpl is the View layer in MVC;
2. the Model layer of ThinkPHP is the most powerful Model layer I have ever seen. I have used Hibernate in Java. I also need to configure the database tables. it seems that the steps are cumbersome, however, the Model layer of ThinkPHP only requires a Model class with the same name as the database table to implement the ORM, and even the framework M ('Table name') can be used without the need to create a Model class ') it is convenient to implement the ORM method;
3. to add a new module or function, the procedure is simple: (1) which database table is used to create the corresponding Model class. if you need to add a custom method to the Model class; (2) create an Action class, that is, a new module, and create a method, that is, a function, in the Action Class. (3) If you need a page, in Tpl, follow the Action name and method name to name the template. in this way, the basic module is done;
4. according to the boss's guidance, the Model layer should not process any business (even a simple operation), and the Model layer should have no idea about the business, it only performs database operations, but some services are not suitable in the Action, so this framework lacks an intermediate layer, which can make the framework division clearer and improve the efficiency of adding functions and modifying code, fewer errors.
I hope that I will have a deeper understanding of this framework in the future.