Thinkphp internal functions
SubmittedMjxheheOn 2010, January 20, PM. php
D, F, S, C, L, A, and I are all in functions. php.
Next I will explain their functions separately.
D () load model class
M () load model class
A () load action class
L () Obtain language Definitions
C () Get configuration value usage is C ("the subscript entered in the array in the configuration file ")
S () Global cache configuration usage S ("This is a unique identifier ")
F () Fast File Data Reading and saving for simple types of data strings, Arrays
I () quickly create an object instance
If any of the above internal functions is missing
Thinkphp is worth learning the source code, especially their Chinese comments, which makes it easy for us to understand the content in the source code.
Using thinkphpProgramInternal functions that can be used frequently. Replacing this one with S () will reduce the burden on the database!
In thinkphp, the configuration file is saved as a static variable and can be conveniently and quickly called in the template.
If {$ thinkphp. config. parameter name}
If the primary key increases automatically, when you use add (), it will automatically return an id value for inserting a new record.
We need to add 1 to the specified field when making user gold coins, points, or votes. At this time, we can write
$ S = D ('admin'); $ S-> score = '(score + 1)'; $ S-> Save (); this leaves us with many steps.
If you want to modify a specified field, use the simple method d ('admin')-> setfield ('name', 'he', 'Id = 2 ');
We need to flexibly apply thinkphp query statements.
Size: 389X500
Browsing: 7 times
Click Open new window to view the full graph "width =" 389 "Height =" 500 "style =" padding: 0px; margin: 0px; ">