Due to work needs, I need to use Thinkphp framework, but I do not know PHP very well, I think the best way to quickly master a language or a framework is to make a small work, only in this work, can quickly master. Here are my notes on three days of learning Thinkphp (about five to six hours a day) for your reference. Write bad place, hope everybody elder come to give advice. Little woman is not much nonsense.

The first day

Before learning PHP and Thinkphp framework, I also checked relevant materials and made a small summary. This is the brain map I made

  • The first step is to create your own project directory (my directory is called shop) and then create the entry file shop/index.php in the project directory
  • The second step is to create a virtual host to access the application. But for convenience, I directly download the integrated environment (WAMP), beginners can directly download WAMP. Put your own project directory files can be created under WWW. Three folder directories above index will automatically appear after running.

    Since I am using the WAMP integrated environment, here is how to configure the virtual host with Apache. Create a virtual host for Apache

    Perform domain name resolution for the local hosts file

    At this point, the first mini-phase is over. Here’s a quick tidbit: As you can see in the image above, when the first smiley face appears, a file is automatically generated in the directory file and a default application module, Home, is generated.

I don’t know if anyone has opened an index.html file and found nothing, but what is it for? This is a directory security file automatically generated by ThinkPHP. The secure directory file mechanism is enabled by default. When a directory is automatically generated, a blank index. HTML file is generated. Of course, the name of the secure file can be set. For example, if you want to define the security file as default. HTML, add the following to the entry file: define(‘DIR_SECURE_FILENAME’, ‘default.html’); define(‘APP_PATH’,’./Application/’); require ‘./ThinkPHP/ThinkPHP.php’; If your environment is secure enough and you do not want to generate directory security files, you can disable directory security file generation in the entry file, for example:

Copy the code

How sleepy ah, forget it, stay up late disfigurement ah, tomorrow night to write (this is my project address)