Thinkphp is a more than a Chinese people use a framework, the concrete is not much, do not know can go to Baidu a bit.
Now we are going to talk about how to use the existing semi-finished system to achieve two times development
The two development of thinkphp had to say that his brother Onethink,onethink and thinkphp. The model mechanism and plug-in mechanism provide great convenience to the developers.
1. Understanding the Onethink directory structure
If you haven't learned thinkphp, I suggest you go ahead and learn it. thinkphp is learning two times development, when you learn thinkphp, you will easily find that the expansion of the inside of a addons yes this is the plugin mechanism mentioned earlier, this folder is put plug-in, Plug-ins will also be the focus of learning below.
2. The first plug-in learning in life
1. Learn the plugin configuration in the background
Specifically, you can read this article
Onethink background Add plug-in steps
Let's take one of the Onethink's own plugins as an example
1.config.php (necessary)
Where the title is the key value can be freely configured
Title must be filled
Type must be filled
Tip selected as a hint after title
Options are also configured when type is select
The value at the end is the switch condition at the time of configuration initialization
2. $name. Addons.class.php Necessary
All of the information is required to be displayed on the plugin list.
Public $info = Array ( ' name ' = ' DevTeam ', ' title ' = ' Development team information ', ' description ' = ' Developer team member Information ', ' Status ' =>1, ' author ' = ' thinkphp ', ' version ' = ' 0.1 ' );
It is particularly important to note that the hook method acquires configuration information by using the function GetConfig to get all the configuration information under the config.php file.
3.widget.html non-essential files if it involves an output template, write it.
It is important to note that {$addons _config.width} Gets the value of the key in the width array, but the value of options passed by key in the options is displayed as a background display configuration.
Now that the first Onethink simple plugin has been completed, I will analyze the system developed by Onethink.
thinkphp-Two-time development 1